mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-16 18:44:01 +02:00
Prevent overflowing static backdrop modal animation (#30326)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
This commit is contained in:
@@ -626,6 +626,25 @@ describe('Modal', () => {
|
||||
modal.show()
|
||||
})
|
||||
|
||||
it('should not overflow when clicking outside of modal-content if backdrop = static', done => {
|
||||
fixtureEl.innerHTML = '<div class="modal" data-backdrop="static"><div class="modal-dialog" style="transition-duration: 20ms;"></div></div>'
|
||||
|
||||
const modalEl = fixtureEl.querySelector('.modal')
|
||||
const modal = new Modal(modalEl, {
|
||||
backdrop: 'static'
|
||||
})
|
||||
|
||||
modalEl.addEventListener('shown.bs.modal', () => {
|
||||
modalEl.click()
|
||||
setTimeout(() => {
|
||||
expect(modalEl.clientHeight === modalEl.scrollHeight).toEqual(true)
|
||||
done()
|
||||
}, 20)
|
||||
})
|
||||
|
||||
modal.show()
|
||||
})
|
||||
|
||||
it('should not adjust the inline body padding when it does not overflow', done => {
|
||||
fixtureEl.innerHTML = '<div class="modal"><div class="modal-dialog"></div></div>'
|
||||
|
||||
|
Reference in New Issue
Block a user