aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.autocomplete.js
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2010-02-20 01:32:55 +0000
committerScott González <scott.gonzalez@gmail.com>2010-02-20 01:32:55 +0000
commit0292c347bb15aab05f5e96957e30d6835152fffe (patch)
tree1e3acb7533a8c780b278a063f041182c6cf6530e /ui/jquery.ui.autocomplete.js
parent74120e0df18669c0e00393ace867a6ef0c468d8f (diff)
downloadjquery-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.js5
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 );