Opened 3 years ago

Closed 3 years ago

#15056 closed bug (notabug)

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

Change History (1)

comment:1 Changed 3 years ago by Scott González

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.

Note: See TracTickets for help on using tickets.