diff options
author | Scott González <scott.gonzalez@gmail.com> | 2011-10-12 16:25:59 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2011-10-12 16:25:59 -0400 |
commit | 75415b35eafbd09fbc804d6cfe6d9d6b6b65d17d (patch) | |
tree | 586f64dcbf5f035d2941b083537cc308ce89c3a2 /ui/jquery.ui.autocomplete.js | |
parent | 84e99650bf2d8712d9997f36e2c5663cdf8a99ea (diff) | |
download | jquery-ui-75415b35eafbd09fbc804d6cfe6d9d6b6b65d17d.tar.gz jquery-ui-75415b35eafbd09fbc804d6cfe6d9d6b6b65d17d.zip |
Autocomplete: Don't react to the escape key if the menu isn't open. Fixes #7579 - autocomplete overwrites input erroneously when user hits ESC before timeout expires.
Diffstat (limited to 'ui/jquery.ui.autocomplete.js')
-rw-r--r-- | ui/jquery.ui.autocomplete.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js index 853de21ae..2618597b1 100644 --- a/ui/jquery.ui.autocomplete.js +++ b/ui/jquery.ui.autocomplete.js @@ -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 |