Skip to content

Commit e886e4a

Browse files
committed
Dialog Tests: Add test to ensure dialog keeps focus when clicking a modal overlay
1 parent d1505e3 commit e886e4a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/unit/dialog/dialog_events.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,4 +355,16 @@ test("#5184: isOpen in dialogclose event is true", function() {
355355
el.remove();
356356
});
357357

358+
test("ensure dialog keeps focus when clicking modal overlay", function() {
359+
expect( 2 );
360+
361+
var el = $( "<div></div>" ).dialog({
362+
modal: true
363+
});
364+
ok( $(":focus").closest(".ui-dialog").length, "focus is in dialog" );
365+
$(".ui-widget-overlay").simulate("mousedown");
366+
ok( $(":focus").closest(".ui-dialog").length, "focus is still in dialog" );
367+
el.remove();
368+
});
369+
358370
})(jQuery);

0 commit comments

Comments
 (0)