Skip to content
Browse files

Autocomplete: Always reset this.term after a select event, even if th…

…e select is cancelled. Fixes #6221 - Autocomplete: Doesn't reset after Select when textbox cleared, if same letters typed in rapidly; source function not triggered in that case.
  • Loading branch information
scottgonzalez committed Oct 25, 2010
1 parent a0847f3 commit 5c67ed26e8c36c42c9f149fcfb2f5fe9e1192b26
Showing with 3 additions and 1 deletion.
  1. +3 −1 ui/jquery.ui.autocomplete.js
@@ -181,9 +181,11 @@ $.widget( "ui.autocomplete", {

if ( false !== self._trigger( "select", event, { item: item } ) ) {
self.term = item.value;
self.element.val( item.value );
// reset the term after the select event
// this allows custom select handling to work properly
self.term = self.element.val();

This comment has been minimized.

Copy link

grandecomplex Mar 20, 2013

Thanks so much for helping on the autocomplete plugin. I'm curious why you don't do: self.term = "";

With my custom menu autocomplete, I found if I change that line to (now) this.term = ""; it fixes the dup value in text field bug.

I got this changelist link from this:

This comment has been minimized.

Copy link

scottgonzalez Mar 20, 2013

Author Member

I have no idea what bug you're referring to. If you're having problems, please file a new ticket with a reduced test case against the latest version of jQuery UI.

self.close( event );
self.selectedItem = item;

0 comments on commit 5c67ed2

Please sign in to comment.
You can’t perform that action at this time.