Skip to content
Permalink
Browse files

Autocomplete: Deactivate menu on close.

Fixes #5205 - Autocomplete: blur causes last active menu item to be selected.
  • Loading branch information...
scottgonzalez committed Feb 20, 2010
1 parent 74120e0 commit 0292c347bb15aab05f5e96957e30d6835152fffe
Showing with 3 additions and 2 deletions.
  1. +3 −2 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 );

0 comments on commit 0292c34

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