]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Backport #30326 (Unit test)
authorysds <ysds.code@gmail.com>
Thu, 25 Jun 2020 15:56:10 +0000 (00:56 +0900)
committerXhmikosR <xhmikosr@gmail.com>
Mon, 6 Jul 2020 13:40:27 +0000 (16:40 +0300)
js/tests/unit/modal.js

index 5434987d8bfe055225824519250e6ee5a863b6c7..3920fe387f6d066561cdf184a054373840d02018 100644 (file)
@@ -959,4 +959,21 @@ $(function () {
         keyboard: false
       })
   })
+
+  QUnit.test('should not overflow when clicking outside of modal-content if backdrop = static', function (assert) {
+    assert.expect(1)
+    var done = assert.async()
+    var $modal = $('<div class="modal" data-backdrop="static"><div class="modal-dialog" style="transition-duration: 20ms;"/></div>').appendTo('#qunit-fixture')
+
+    $modal.on('shown.bs.modal', function () {
+      $modal.trigger('click')
+      setTimeout(function () {
+        assert.strictEqual($modal[0].clientHeight, $modal[0].scrollHeight)
+        done()
+      }, 20)
+    })
+      .bootstrapModal({
+        backdrop: 'static'
+      })
+  })
 })