Skip to content

Commit

Permalink
Autocomplete: Don't react to the escape key if the menu isn't open. F…
Browse files Browse the repository at this point in the history
…ixes #7579 - autocomplete overwrites input erroneously when user hits ESC before timeout expires.
  • Loading branch information
scottgonzalez committed Oct 12, 2011
1 parent 84e9965 commit 75415b3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ui/jquery.ui.autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,10 @@ $.widget( "ui.autocomplete", {
self.menu.select( event );
break;
case keyCode.ESCAPE:
self._value( self.term );
self.close( event );
if ( self.menu.element.is(":visible") ) {
self._value( self.term );
self.close( event );
}
break;
default:
// search timeout should be triggered before the input value is changed
Expand Down

0 comments on commit 75415b3

Please sign in to comment.