Skip to content

Commit

Permalink
Autocomplete: Prevent the default action on escape when the menu is o…
Browse files Browse the repository at this point in the history
…pen. Fixes #8282 - Double escape clear IE form, continue Ticket #7643.
  • Loading branch information
scottgonzalez committed Apr 30, 2012
1 parent 21df5c2 commit 4ab7d53
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ui/jquery.ui.autocomplete.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ $.widget( "ui.autocomplete", {
if ( self.menu.element.is(":visible") ) { if ( self.menu.element.is(":visible") ) {
self._value( self.term ); self._value( self.term );
self.close( event ); self.close( event );
// Different browsers have different default behavior for escape
// Single press can mean undo or clear
// Double press in IE means clear the whole form
event.preventDefault();
} }
break; break;
default: default:
Expand Down

0 comments on commit 4ab7d53

Please sign in to comment.