Skip to content

Commit 8f802c9

Browse files
committed
fixed: focus problem when toggle menu, thx to phazei for reporting this issue, see https://github.com/fnagel/jquery-ui/issues#issue/22
1 parent cc6290c commit 8f802c9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ui/jquery.ui.selectmenu.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ $.widget("ui.selectmenu", {
7171
//click toggle for menu visibility
7272
this.newelement
7373
.bind('mousedown', function(event){
74-
self._toggle(event);
74+
self._toggle(event, true);
7575
//make sure a click won't open/close instantly
7676
if(o.style == "popup"){
7777
self._safemouseup = false;
@@ -416,7 +416,9 @@ $.widget("ui.selectmenu", {
416416
.attr('aria-hidden', true)
417417
.removeClass(this.widgetBaseClass+'-open');
418418
if(this.options.style == "dropdown"){ this.newelement.removeClass('ui-corner-top').addClass('ui-corner-all'); }
419-
if(retainFocus){this.newelement[0].focus();}
419+
console.log(this.newelement);
420+
console.log(this.retainFocus);
421+
if(retainFocus){this.newelement.focus();}
420422
this._trigger("close", event, this._uiHash());
421423
}
422424
},

0 commit comments

Comments
 (0)