diff options
author | Scott González <scott.gonzalez@gmail.com> | 2012-02-11 10:12:51 -0500 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2012-02-11 10:12:51 -0500 |
commit | 530d4cb40814c68163197f8091322e2258f0e57a (patch) | |
tree | 3f2835f9c814e5543903533b72f1e160266373fe /ui/jquery.ui.autocomplete.js | |
parent | 041cb39a6667e3637a40fad6ef952da476f2af97 (diff) | |
download | jquery-ui-530d4cb40814c68163197f8091322e2258f0e57a.tar.gz jquery-ui-530d4cb40814c68163197f8091322e2258f0e57a.zip |
Autocomplete: Cancel search when closing the menu. Fixes #7523 - Autocomplete cancel pending request when text changes below minLength.
Diffstat (limited to 'ui/jquery.ui.autocomplete.js')
-rw-r--r-- | ui/jquery.ui.autocomplete.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js index 14e8a2a86..ba0062410 100644 --- a/ui/jquery.ui.autocomplete.js +++ b/ui/jquery.ui.autocomplete.js @@ -383,7 +383,8 @@ $.widget( "ui.autocomplete", { this._suggest( content ); this._trigger( "open" ); } else { - this.close(); + // use ._close() instad of .close() so we don't cancel future searches + this._close(); } this.pending--; if ( !this.pending ) { @@ -392,6 +393,11 @@ $.widget( "ui.autocomplete", { }, close: function( event ) { + this.cancelSearch = true; + this._close( event ); + }, + + _close: function( event ) { clearTimeout( this.closing ); if ( this.menu.element.is(":visible") ) { this.menu.element.hide(); |