Skip to main content

Search and Top Navigation

#5928 closed bug (notabug)

Opened August 11, 2010 08:52PM UTC

Closed August 18, 2010 01:52PM UTC

Last modified October 11, 2012 09:15PM UTC

When a user selects an item in the autocomplete dropdown list, the order of events being fired has change from version 1.8.2

Reported by: dhopman Owned by:
Priority: major Milestone:
Component: ui.autocomplete Version: 1.8.4
Keywords: Cc:
Blocked by: Blocking:

In version 1.8.2 the autocomplete select event would fire before the focus event fires on the control itself.

In version 1.8.4 the focus event on the control fires before the before the select event fires.

This causes issues, when needing to know what data was selected on the focus event of the control itself, since the select has not fired yet.

Attachments (0)
Change History (5)

Changed August 12, 2010 02:31AM UTC by scottgonzalez comment:1

Why are you trying to use the focus event to figure out what item was selected?

Changed August 18, 2010 01:52PM UTC by scottgonzalez comment:2

resolution: → invalid
status: newclosed

Changed May 06, 2011 11:02PM UTC by ekkis comment:3

there is a valid use case for the behaviour in 1.8.2, which I believe to be more correct than that in 1.8.4 - if I need to insert a database record on the back only when the user has NOT picked a value from the autoselect list, the place to do it is in the /focusout/ event. If the /select/ event fires before /focusout/ does I get the chance to set a flag indicating a selection has been made (and therefore the entry already exists in the database). Therefore, when the user leaves the field, I can decide to insert a record on the basis that a value NOT picked from the autocomplete is being entered.

If you reverse the order of events, I'm out of luck.

In fact, clicking on the autocomplete list should not fire a /focusout/ event at all because the user is not really leaving the field, he's merely using a built-in mechanism for completing his entry.

so how is it now recommended we accomplish the above?

Changed May 09, 2011 12:38PM UTC by scottgonzalez comment:4

Use the change event, which will tell you if a valid item was chosen (ui.item will exist).

Changed October 11, 2012 09:15PM UTC by scottgonzalez comment:5

milestone: TBD

Milestone TBD deleted