#15130 closed bug (notabug)
Autocomplete: keyboard navigation with source object
Reported by: | Rob Garrison | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | none |
Component: | ui.autocomplete | Version: | 1.12.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Set up autocomplete with a source object. When using a mouse, the input value is updated with highlighted menu item. But when using keyboard navigation (up, down, pageUp, pageDown) to focus on an item, the source value instead of the source label is added to the input.
See the issue in this demo: http://jsbin.com/koregobilu/edit?html,output
Versions of jQuery tested that demonstrate this same problem:
- 1.12.1
- 1.11.4
- 1.10.4
- 1.9.2
Tested in the latest versions of Chrome & Firefox on a Windows 10 64-bit system.
Screenshot:
Change History (5)
comment:2 follow-up: 3 Changed 6 years ago by
The value is supposed to be inserted into the text field. The documentation even says so. The bug is that the label gets inserted with hover, not that the value gets inserted with keyboard navigation.
comment:4 Changed 6 years ago by
Resolution: | → notabug |
---|---|
Status: | new → closed |
This is actually not a bug. You're setting the value explicitly in the focus
event. The widget is always setting the correct value on its own, which only happens during keyboard navigation.
comment:5 Changed 6 years ago by
This is probably the behavior you were trying to create: http://jsbin.com/pugidaleza/1/edit?html,output
I also failed to mention that pressing Enter would add the source value instead of the source label to the input. I have submitted a PR: https://github.com/jquery/jquery-ui/pull/1792