Skip to main content

Search and Top Navigation

#12755 closed feature (notabug)

Opened May 19, 2015 05:49PM UTC

Closed May 28, 2015 03:03PM UTC

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.

Attachments (0)
Change History (3)

Changed May 19, 2015 06:00PM UTC by scottgonzalez comment:1

component: ui.coreui.autocomplete
owner: → friendly_lemur_loves_you
status: newpending

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

Changed May 28, 2015 02:46PM UTC by friendly_lemur_loves_you comment:2

status: pendingnew

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

Changed May 28, 2015 03:03PM UTC by scottgonzalez comment:3

resolution: → notabug
status: newclosed