#6661 closed bug (fixed)
Autocomplete: Tab on multiple Autocomplete should not change focus after selecting
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | minor | Milestone: | 1.8.7 |
Component: | ui.autocomplete | Version: | 1.8.6 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
- Create a multiple-autocomplete (or go to http://jqueryui.com/demos/autocomplete/#multiple).
- Type the beginning of a valid entry (e.g. "ja")
- Press the down arrow to highlight the first entry
- Press TAB
What happens: the entry is selected the autocomplete panel closes a separater is insert into the autocomplete input focus moves to the next form element or link.
What should happen: the entry is selected the autocomplete panel closes a separater is insert into the autocomplete input (focus remains in the autocomplete input, awaiting the next item)
NB: a _second_ TAB press, when the panel isn't open, _should_ change focus.
The problem lies in these lines:
passthrough - ENTER and TAB both select the current element case keyCode.TAB:
if ( !self.menu.active ) {
return;
} self.menu.select(); break;
If self.menu.active is true, the event's default behavior should be prevented, just like in the case for keyCode.ENTER.
Change History (5)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
If option 1 is the case, see https://github.com/jamesarosen/jquery-ui/tree/6661_fix_1 for a fix to the demo.
If option 2 is the case, see https://github.com/jamesarosen/jquery-ui/tree/6661_fix_2 for a fix to the autocomplete library itself.
comment:3 Changed 12 years ago by
Milestone: | TBD → 1.9 |
---|---|
Status: | new → open |
Summary: | Tab on multiple Autocomplete should not change focus after selecting → Autocomplete: Tab on multiple Autocomplete should not change focus after selecting |
comment:4 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | open → closed |
Autocomplete multiple demos: Don't leave the field when tabbing while the menu is open. Fixes #6661 - Autocomplete: Tab on multiple Autocomplete should not change focus after selecting.
Changeset: 46376958940fa7823c2e5ef4fb15b87c7d2f47db
comment:5 Changed 12 years ago by
Milestone: | 1.9 → 1.8.7 |
---|
Now that I look at the example more closely, it seems to me that the desired behavior is in the example's "select" function rather than in the library itself. Indeed, adding
event.preventDefault();
to the beginning of the example's "select" function works as expected. Thus, the question is now:
or