1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-15 10:05:40 +02:00

Revert backdrop utilization, handling clicks over modal (#36324)

* refactor(Modal.js): stop using backdrop class to handle clicks over modal

* Revert #35554 and backdrop callback usage
  Explanation: In order to bypass `.modal`, was applied a css rule `pointer-events:none` which caused the side effect, and user couldn't scroll "long content modals"

* Update .bundlewatch.config.json

Co-authored-by: Mark Otto <markd.otto@gmail.com>
This commit is contained in:
GeoSot
2022-05-13 07:20:04 +03:00
committed by GitHub
parent 88a6610895
commit b167420bdf
4 changed files with 23 additions and 25 deletions

View File

@@ -642,11 +642,8 @@ describe('Modal', () => {
modalEl.addEventListener('shown.bs.modal', () => {
const spy = spyOn(modal, '_queueCallback').and.callThrough()
const mouseOverEvent = createEvent('mousedown')
const backdrop = document.querySelector('.modal-backdrop')
backdrop.dispatchEvent(mouseOverEvent)
backdrop.dispatchEvent(mouseOverEvent)
modalEl.click()
modalEl.click()
setTimeout(() => {
expect(spy).toHaveBeenCalledTimes(1)
@@ -714,8 +711,7 @@ describe('Modal', () => {
const modalEl = fixtureEl.querySelector('.modal')
const modal = new Modal(modalEl)
modalEl.addEventListener('shown.bs.modal', () => {
const mouseOverEvent = createEvent('mousedown')
document.querySelector('.modal-backdrop').dispatchEvent(mouseOverEvent)
modalEl.click()
})
modalEl.addEventListener('hidden.bs.modal', () => {