Bug Tracker

Modify

Ticket #3138 (closed bug: invalid)

Opened 5 years ago

Last modified 4 years ago

[autocomplete] plugin - result handler not called when exact match is typed

Reported by: colin.johnson Owned by: joern
Priority: major Milestone: 1.3
Component: plugin Version: 1.2.6
Keywords: Cc:
Blocking: Blocked by:

Description

With autocomplete plugin version 1.0.2 I have bound a result handler to the autocomplete textfield, in order to update a hidden id field with the selected item. The result handler is not currently called when an exact match is typed into the field and the focus moved out of the autocomplete textfield via a mouse click (it does call it when you tab/enter in the textfield).

Change History

comment:1 in reply to: ↑ description Changed 5 years ago by colin.johnso

Replying to colin.johnson:

With autocomplete plugin version 1.0.2 I have bound a result handler to the autocomplete textfield, in order to update a hidden id field with the selected item. The result handler is not currently called when an exact match is typed into the field and the focus moved out of the autocomplete textfield via a mouse click (it does call it when you tab/enter in the textfield).

Not sure of the implications of this change yet but I have implemented a change to the hideResultsNow() function, adding an else on line 305, so if we DO have a result match, then trigger the result handler:

	if ( !result ) {
		... 
		code to empty the input box because no match
		...
	} else {
		// fire the result handler
		$input.trigger("result", result && [result.data, result.value]);
	}

Implications of the change might be that we call the result trigger multple times?

Hope this provides some help.

Thanks

Colin

comment:2 Changed 5 years ago by flesler

  • Owner set to joern

comment:3 Changed 4 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.