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.

This commit is contained in:
Scott González 2010-07-20 15:13:54 -04:00
parent 123467af8e
commit e85615fc6b

View File

@ -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