diff options
author | Scott González <scott.gonzalez@gmail.com> | 2010-02-20 01:32:55 +0000 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2010-02-20 01:32:55 +0000 |
commit | 0292c347bb15aab05f5e96957e30d6835152fffe (patch) | |
tree | 1e3acb7533a8c780b278a063f041182c6cf6530e /ui/jquery.ui.autocomplete.js | |
parent | 74120e0df18669c0e00393ace867a6ef0c468d8f (diff) | |
download | jquery-ui-0292c347bb15aab05f5e96957e30d6835152fffe.tar.gz jquery-ui-0292c347bb15aab05f5e96957e30d6835152fffe.zip |
Autocomplete: Deactivate menu on close.
Fixes #5205 - Autocomplete: blur causes last active menu item to be selected.
Diffstat (limited to 'ui/jquery.ui.autocomplete.js')
-rw-r--r-- | ui/jquery.ui.autocomplete.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js index ee923b2f4..2fc893cab 100644 --- a/ui/jquery.ui.autocomplete.js +++ b/ui/jquery.ui.autocomplete.js @@ -50,11 +50,11 @@ $.widget( "ui.autocomplete", { break; case keyCode.ENTER: // when menu is open or has focus - if ( self.menu && self.menu.active ) { + if ( self.menu.active ) { event.preventDefault(); } case keyCode.TAB: - if ( !self.menu || !self.menu.active ) { + if ( !self.menu.active ) { return; } self.menu.select(); @@ -209,6 +209,7 @@ $.widget( "ui.autocomplete", { if ( this.menu.element.is(":visible") ) { this._trigger( "close", event ); this.menu.element.hide(); + this.menu.deactivate(); } if ( this.previous != this.element.val() ) { this._trigger( "change", event ); |