Skip to content

Commit a68d5ca

Browse files
kborchersjzaefferer
authored andcommitted
Dialog: Add unit test to cover #8789 and #8838.
1 parent 7e9060c commit a68d5ca

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/unit/dialog/dialog_events.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,4 +325,20 @@ test("beforeClose", function() {
325325
el.remove();
326326
});
327327

328+
// #8789 and #8838
329+
asyncTest("ensure dialog's container doesn't scroll on resize and focus", function() {
330+
expect(2);
331+
332+
var el = $('#dialog1').dialog(),
333+
initialScroll = $(window).scrollTop();
334+
el.dialog('option', 'height', 600);
335+
equal($(window).scrollTop(), initialScroll, "scroll hasn't moved after height change");
336+
setTimeout( function(){
337+
$(".ui-dialog-titlebar-close").simulate('mousedown');
338+
equal($(window).scrollTop(), initialScroll, "scroll hasn't moved after focus moved to dialog");
339+
el.dialog('destroy');
340+
start();
341+
}, 500);
342+
});
343+
328344
})(jQuery);

0 commit comments

Comments
 (0)