From adcafce7a24156c503061eb354867e41064fd89f Mon Sep 17 00:00:00 2001 From: Scott González Date: Mon, 27 Sep 2010 10:10:00 -0400 Subject: Autocomplete: Only prevent the default action for enter when a menu item is active. Fixes #6038 - Autocomplete: Allow default behaviour on enter when menu is open but inactive. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks Ján Suchal. --- ui/jquery.ui.autocomplete.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ui/jquery.ui.autocomplete.js') diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js index 680a81f29..2d1d7f94b 100644 --- a/ui/jquery.ui.autocomplete.js +++ b/ui/jquery.ui.autocomplete.js @@ -63,8 +63,8 @@ $.widget( "ui.autocomplete", { break; case keyCode.ENTER: case keyCode.NUMPAD_ENTER: - // when menu is open or has focus - if ( self.menu.element.is( ":visible" ) ) { + // when menu is open and has focus + if ( self.menu.active ) { event.preventDefault(); } //passthrough - ENTER and TAB both select the current element -- cgit v1.2.3