Opened 8 years ago

Closed 8 years ago

#7339 closed bug (notabug)

/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:

Description

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).

Change History (2)

comment:1 Changed 8 years ago by ekkis

additional thoughts:

  1. keyboard selection of an item from the list does not generate a /blur/... therefore neither should mouse selection
  1. the issue is really probably more relevant with the /change/ event, since that actually what we care about
  1. 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

comment:2 Changed 8 years ago by Scott González

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.

Note: See TracTickets for help on using tickets.