Bug Tracker

Opened 15 years ago

Closed 14 years ago

#3138 closed bug (invalid)

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

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 (3)

comment:1 in reply to:  description Changed 15 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 15 years ago by flesler

Owner: set to joern

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