Skip to main content

Search and Top Navigation

#15056 closed bug (notabug)

Opened September 30, 2016 09:27PM UTC

Closed October 01, 2016 03:23AM UTC

Modifier keys cause highlighted autocomplete to search with currently highlighted option.

Reported by: aiudirog Owned by:
Priority: minor Milestone: none
Component: ui.widget Version: 1.11.4
Keywords: Cc:
Blocked by: Blocking:
Description

In an attempt to make it so that tab and shift-tab could cycle through the options in an autocomplete widget, I found that shift (and the other modifier keys) fall through the switch case that begins on line 108 (current Git version) in the keydown event handler, which causes the _searchTimeout function to be called when they are hit. This prevents them from being used to operate in conjunction with any other key without forcing a search. In the case of using shift-tab to cycle up through the options, when shift is pressed, the search is called, the first item is selected, and the autocomplete list shortens to items that begin with it before I can even hit tab. An easy fix is to simply expand the switch statement to ignore modifiers if they are the only key hit and leave them up to the programmer to handle on each specific input:

https://github.com/jquery/jquery-ui/compare/master...aiudirog:patch-1

However, I do not know if this is the proper fix or if it necessarily should be fixed, which is why I didn't submit a pull request.

Thank you

Attachments (0)
Change History (1)

Changed October 01, 2016 03:23AM UTC by scottgonzalez comment:1

resolution: → notabug
status: newclosed

The desired behavior is bad for accessibility and therefore will not result in any changes. If you can provide a supported use case where modifier keys must not trigger a search, we can reopen this ticket.