Skip to main content

Search and Top Navigation

#9456 closed bug (notabug)

Opened July 24, 2013 09:58PM UTC

Closed July 25, 2013 02:19AM UTC

AutoFocus flicker when combined with focus autocomplete("search")

Reported by: SteveHansen Owned by:
Priority: minor Milestone: none
Component: ui.autocomplete Version: 1.10.3
Keywords: Cc:
Blocked by: Blocking:
Description

Hey guys,

I've come across an issue when using autocomplete with

autoFocus=true

combined with:

.focus(function (e) {
      $(this).autocomplete("search");
}

to open the list of options.

There's some kind of race condition where the first element in the list is selected for a second and then becomes deselected.

Both features work independently but when combined there is an issue.

Tested in chrome 28.

fiddle: http://jsfiddle.net/Beefo/VaWmY/6/

Attachments (0)
Change History (1)

Changed July 25, 2013 02:19AM UTC by scottgonzalez comment:1

resolution: → notabug
status: newclosed

What you're seeing is the menu responding to the mouse click outside of the menu. The click event is still occurring at the time the menu is rendered. If you want to show the menu on focus, then you should use a delay (and you should actually use the focus event like your description says, as opposed to a click event like the fiddle is using).