Ticket #5971 (closed bug: notabug)

Opened 3 years ago

Last modified 7 months ago

When scrollling through autocomplete suggestions using up/down arrow keys, highlighted text is copied to the input element, which may make it appear that a selection has been made

Reported by: ryounes Owned by:
Priority: minor Milestone:
Component: ui.autocomplete Version: 1.8.2
Keywords: autocomplete, scroll, arrow key, selection Cc:
Blocking: Blocked by:

Description

This can be tested on the jQuery UI autocomplete demo pages: when scrolling through the list of autocomplete suggestions using up/down arrow keys, the highlighted text is copied to the input element. This does not happen when hovering over a suggestion with the mouse. I have seen it confuse a user into thinking that a selection has been made, although the select event is not actually fired until the user either presses the enter key or clicks on the item with the mouse. I have checked out other autocomplete widgets and have not seen this behavior.

Change History

comment:1 Changed 3 years ago by scott.gonzalez

  • Status changed from new to closed
  • Resolution set to invalid

This is by design. This is exactly how Firefox's location bar work, which is the model that we're following.

comment:2 Changed 3 years ago by danheberden

A quick note, this behavior can easily be disabled by halting the focus event.

e.g.

jQuery('#element').autocomplete({
       focus: function(event, ui) {
            event.preventDefault(); // or return false;
       }
});

comment:3 Changed 7 months ago by scott.gonzalez

  • Milestone TBD deleted

Milestone TBD deleted

Note: See TracTickets for help on using tickets.