Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralpadev <2838324+alpadev@users.noreply.github.com>2021-06-03 14:44:16 +0300
committerGitHub <noreply@github.com>2021-06-03 14:44:16 +0300
commit4a5029ea29ac75243dfec68153051292fc70f5cf (patch)
tree7d0a74707b0f1ab8254610a53dcbf92eabae81b4 /js/tests/unit/modal.spec.js
parent071a288d39f70719c771cd56ded6c36b5d150a83 (diff)
Fix handling of transitionend events dispatched by nested elements(#33845)
Fix handling of transitionend events dispatched by nested elements Properly handle events from nested elements Change `emulateTransitionEnd` to `executeAfterTransition` &&
Diffstat (limited to 'js/tests/unit/modal.spec.js')
-rw-r--r--js/tests/unit/modal.spec.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/js/tests/unit/modal.spec.js b/js/tests/unit/modal.spec.js
index f73ac40b55..2974495cac 100644
--- a/js/tests/unit/modal.spec.js
+++ b/js/tests/unit/modal.spec.js
@@ -539,6 +539,29 @@ describe('Modal', () => {
modal.show()
})
+ it('should not queue multiple callbacks when clicking outside of modal-content and backdrop = static', done => {
+ fixtureEl.innerHTML = '<div class="modal"><div class="modal-dialog" style="transition-duration: 50ms;"></div></div>'
+
+ const modalEl = fixtureEl.querySelector('.modal')
+ const modal = new Modal(modalEl, {
+ backdrop: 'static'
+ })
+
+ modalEl.addEventListener('shown.bs.modal', () => {
+ const spy = spyOn(modal, '_queueCallback').and.callThrough()
+
+ modalEl.click()
+ modalEl.click()
+
+ setTimeout(() => {
+ expect(spy).toHaveBeenCalledTimes(1)
+ done()
+ }, 20)
+ })
+
+ modal.show()
+ })
+
it('should enforce focus', done => {
fixtureEl.innerHTML = '<div class="modal"><div class="modal-dialog"></div></div>'