From: Scott González Date: Tue, 20 Jul 2010 19:13:54 +0000 (-0400) Subject: Autocomplete: Prevent the default behavior of pressing enter when the menu is open... X-Git-Tag: 1.8.3~31 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e85615fc6b1d636f4bcea3abd3a6091f937858b8;p=jquery-ui.git Autocomplete: Prevent the default behavior of pressing enter when the menu is open, even if no item is active. Partial fix for #5757 - Autocomplete combobox issues. --- diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js index b9daad86b..4b37a000d 100644 --- a/ui/jquery.ui.autocomplete.js +++ b/ui/jquery.ui.autocomplete.js @@ -59,7 +59,7 @@ $.widget( "ui.autocomplete", { case keyCode.ENTER: case keyCode.NUMPAD_ENTER: // when menu is open or has focus - if ( self.menu.active ) { + if ( self.menu.element.is( ":visible" ) ) { event.preventDefault(); } //passthrough - ENTER and TAB both select the current element