Skip to content

Commit 00559b3

Browse files
committed
Update popup utility: Defer _open call and let click event propagate.
Fixes other popups to close. Also update aria usage.
1 parent 67d49f5 commit 00559b3

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

tests/visual/menu/popup.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ $.widget( "ui.popup", {
2929
}
3030

3131
this.options.trigger
32-
.attr( "aria-haspop", true )
32+
.attr( "aria-haspopup", true )
3333
.attr( "aria-owns", this.element.attr( "id" ) );
3434

3535
this.element
@@ -38,9 +38,11 @@ $.widget( "ui.popup", {
3838

3939
this._bind(this.options.trigger, {
4040
click: function( event ) {
41-
event.stopPropagation();
4241
event.preventDefault();
43-
this._open( event );
42+
var that = this;
43+
setTimeout(function() {
44+
that._open( event );
45+
}, 1);
4446
}
4547
});
4648

@@ -68,6 +70,10 @@ $.widget( "ui.popup", {
6870
.removeClass( "ui-popup" )
6971
.removeAttr( "aria-hidden" )
7072
.removeAttr( "aria-expanded" );
73+
74+
this.options.trigger
75+
.removeAttr( "aria-haspopup" )
76+
.removeAttr( "aria-owns" );
7177

7278
if ( this.generatedId ) {
7379
this.element.removeAttr( "id" );

0 commit comments

Comments
 (0)