Opened 8 years ago

Closed 8 years ago

#12755 closed feature (notabug)

Autocomplete select event doesn't specify input

Reported by: friendly_lemur_loves_you Owned by: friendly_lemur_loves_you
Priority: minor Milestone: none
Component: ui.autocomplete Version: 1.11.2
Keywords: Cc:
Blocked by: Blocking:

Description

When a user selects one of the choices I provide via jQuery Autocomplete, I want to add a "success" class to the input for styling.

Currently, I see two useful events:

  • If I use $('form').on('autocompletechange'), the event target is the input I want to style. However, this isn't triggered until the input is blurred, and I want to give the user positive feedback as soon as they select something valid.
  • If I use $('form').on('autocompleteselect'), the event fires as soon as I select an autocomplete option. However, the event's target is the <li> of the selected option, and its relatedTarget is null.

I propose that the Event object for autocompleteselect be given the input as its relatedTarget.

Change History (3)

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

Component: ui.coreui.autocomplete
Owner: set to friendly_lemur_loves_you
Status: newpending

The event target is *always* the input. Can you please provide a reduced test case that shows otherwise?

comment:2 Changed 8 years ago by friendly_lemur_loves_you

Status: pendingnew

Nope, I was wrong. Sorry to bother you. Please close.

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

Resolution: notabug
Status: newclosed
Note: See TracTickets for help on using tickets.