Skip to content

Commit 9a6cfeb

Browse files
ysdsXhmikosR
authored andcommitted
Backport #30326 (Unit test)
1 parent ea01c29 commit 9a6cfeb

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

js/tests/unit/modal.js

+17
Original file line numberDiff line numberDiff line change
@@ -959,4 +959,21 @@ $(function () {
959959
keyboard: false
960960
})
961961
})
962+
963+
QUnit.test('should not overflow when clicking outside of modal-content if backdrop = static', function (assert) {
964+
assert.expect(1)
965+
var done = assert.async()
966+
var $modal = $('<div class="modal" data-backdrop="static"><div class="modal-dialog" style="transition-duration: 20ms;"/></div>').appendTo('#qunit-fixture')
967+
968+
$modal.on('shown.bs.modal', function () {
969+
$modal.trigger('click')
970+
setTimeout(function () {
971+
assert.strictEqual($modal[0].clientHeight, $modal[0].scrollHeight)
972+
done()
973+
}, 20)
974+
})
975+
.bootstrapModal({
976+
backdrop: 'static'
977+
})
978+
})
962979
})

0 commit comments

Comments
 (0)