-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
1 parent
a0847f3
commit 5c67ed2
Showing
1 changed file
with
3 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
scottgonzalez
Author
Member
|
||
|
||
self.close( event ); | ||
self.selectedItem = item; | ||
|
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: http://bugs.jqueryui.com/ticket/6221