From: Felix Nagel Date: Tue, 9 Aug 2011 20:01:47 +0000 (+0200) Subject: fixed: problem when hiding first option by css, thx to @RobertSheaO, see #152 X-Git-Tag: selectmenu_v1.2.0~22 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=edee0dcba2dca932e80ce737bee3e0cd83cfdae4;p=jquery-ui.git fixed: problem when hiding first option by css, thx to @RobertSheaO, see #152 --- diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index df7dd8f9a..5a446bb74 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -550,7 +550,7 @@ $.widget("ui.selectmenu", { if ( $.browser.msie && $.browser.version.substr( 0,1 ) == 7 ) { self._refreshPosition(); } - var selected = self.list.attr('aria-hidden', false).find('li:not(.' + self.widgetBaseClass + '-group):eq(' + self._selectedIndex() + ') a'); + var selected = self.list.attr('aria-hidden', false).find('li:not(.' + self.widgetBaseClass + '-group):eq(' + self._selectedIndex() + '):visible a'); if (selected.length) selected[0].focus(); // positioning needed for FF, Chrome, IE8, IE7, IE6 (tested 01.08.11 on MS VPC Image) self._refreshPosition();