Search and Top Navigation
#9029 closed bug (fixed)
Opened January 30, 2013 09:12AM UTC
Closed January 30, 2013 01:36PM UTC
Autocomplete: Multiple demo has errors
| Reported by: | deap82 | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | 1.10.1 |
| Component: | ui.autocomplete | Version: | 1.10.0 |
| Keywords: | Cc: | ||
| Blocked by: | Blocking: |
Description
There is an error when trying to tab away from a multiple autocomplete decorated textbox, the bug exists in this demo:
http://jqueryui.com/autocomplete/#multiple
Replicate error by typing "ja" in the textbox and then press tab.
The error message is: Uncaught TypeError: Cannot read property 'menu' of undefined
which is caused by the fact that $(this).data("autocomplete") is undefined.
The error resides in the demo codes keydown handler, I have replaced that code with the following:
if (event.keyCode === $.ui.keyCode.TAB &&
$('.ui-autocomplete.ui-menu a.ui-state-focus:visible').length > 0) {
event.preventDefault();
}
The result is that the default action of pressing tab only will be prevented when an item is actually selected in the suggestion list. This works in my case when I have only one autocomplete textbox within the page. A more general solution is probably needed.
Attachments (0)
Change History (4)
Changed January 30, 2013 01:13PM UTC by comment:1
| resolution: | → duplicate |
|---|---|
| status: | new → closed |
Changed January 30, 2013 01:35PM UTC by comment:2
| resolution: | duplicate |
|---|---|
| status: | closed → reopened |
Changed January 30, 2013 01:35PM UTC by comment:3
| milestone: | none → 1.10.1 |
|---|---|
| status: | reopened → open |
| summary: | Tab error in the autocomplete multiple demo → Autocomplete: Multiple demo has errors |
Duplicate of #8992.