Bug Tracker

Modify

Ticket #4866 (closed bug: invalid)

Opened 3 years ago

Last modified 2 years ago

[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:
Blocking: Blocked by:

Description

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

comment:1 Changed 2 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to invalid

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 .

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.