Skip to main content

Search and Top Navigation

#7339 closed bug (notabug)

Opened May 07, 2011 10:54PM UTC

Closed May 09, 2011 12:39PM UTC

/focusout/ (or /blur/) should not be issued when user picks from the list

Reported by: ekkis Owned by:
Priority: minor Milestone: 1.9.0
Component: ui.autocomplete Version: 1.8.11
Keywords: Cc:
Blocked by: Blocking:

I want to make a case for having this plugin make sure that no /focusout/ or /blur/ events are generated for the textbox when the user makes a selection from the selection list. the argument is that from a functional perspective, the user is not really leaving the textbox, he's merely supplementing his current entry into the textbox by using an extension to the textbox.

firing these events is problematic. consider the following situation: you want to insert the user's entry into a database only when said entry was NOT picked from the list (this would make sense because the data entered obviously does not exist in the database). the insertion would be made on the /blur/ event of the textbox, since that signifies that the user is done with his entry. if no /select/ event was fired, the entry does not exist in the db, otherwise it does.

Now consider that if the textbox receives a /blur/ event when the user goes to make a selection from the list, we have no way of distinguishing between the user being done with his entry, and his continuing to enter data!

from my perspective, issuing the /blur/ is of no value but not issuing it is very valuable indeed.

Incidentally, this ticket is related to #5928, which I could not reopen. Also created # 7336, which can be closed as this supplants it (I can't seem to close it).

Attachments (0)
Change History (2)

Changed May 08, 2011 12:20AM UTC by ekkis comment:1

additional thoughts:

1. keyboard selection of an item from the list does not generate a /blur/... therefore neither should mouse selection

2. the issue is really probably more relevant with the /change/ event, since that actually what we care about

3. another way of stating this: the /select/ event should fire before the /change/ event does, otherwise we have no way of knowing that the change owes to a selection

Changed May 09, 2011 12:39PM UTC by scottgonzalez comment:2

resolution: → invalid
status: newclosed

Don't use the native change event, use the autocompletechange event. The autocompletechange event will tell you if an item was selected (ui.item will exist). Please use the forums for help.