Bug Tracker

Ticket #3138 (new bug)

Opened 5 months ago

Last modified 5 months ago

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

Reported by: colin.johnson Assigned to: joern
Type: bug Priority: major
Milestone: 1.3 Component: plugin
Version: 1.2.6 Keywords:
Cc: Needs: Review

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).

Attachments

Change History

in reply to: ↑ description   Changed 5 months ago by colin.johnson

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

  Changed 5 months ago by flesler

  • owner set to joern
Note: See TracTickets for help on using tickets.