mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-16 18:44:01 +02:00
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` &&
This commit is contained in:
@@ -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>'
|
||||
|
||||
|
Reference in New Issue
Block a user