Bug Tracker

Opened 14 years ago

Closed 13 years ago

Last modified 11 years ago

#4866 closed bug (invalid)

[autocomplete] Doesn't Trigger change Event

Reported by: gtwilliams Owned by:
Priority: minor Milestone: 1.4
Component: plugin Version: 1.3.2
Keywords: autocomplete plugin change event Cc:
Blocked by: Blocking:


When user selects a value in the select list using the mouse, a change event is triggered for the autocomplete input field because of blur. But this change event will yield the typed-in value from the input field. The autocomplete plugin changes the value right after that to the user's selected string. Unfortunately, this does not trigger another change event.

I need to catch change, but I only see the typed-in value. I can ignore this event, but to get the selected value associated with a change event, I modified the plugin to trigger change when the user's selection is stored. (It would be nice to be able to suppress the change event on click of selection choice but I don't know how to do that.)

Here's the patch which starts around line 213:

$input.val(v); hideResultsNow();

+ $input.trigger("change");

$input.trigger("result", [selected.data, selected.value]); return true;

Change History (1)

comment:1 Changed 13 years ago by dmethvin

Resolution: invalid
Status: newclosed

This is not a jQuery core bug. Please report plugin bugs to the plugin's author, or ask on the jQuery forums. jQuery UI bugs should be reported on the UI bug tracker, http://dev.jqueryui.com .

Note: See TracTickets for help on using tickets.