mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-05-27 14:46:01 +03:00
Prevent overflowing static backdrop modal animation (#30326)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
This commit is contained in:
+14
-1
@@ -409,10 +409,23 @@ class Modal {
|
||||
return
|
||||
}
|
||||
|
||||
const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight
|
||||
|
||||
if (!isModalOverflowing) {
|
||||
this._element.style.overflowY = 'hidden'
|
||||
}
|
||||
|
||||
this._element.classList.add(CLASS_NAME_STATIC)
|
||||
const modalTransitionDuration = getTransitionDurationFromElement(this._element)
|
||||
const modalTransitionDuration = getTransitionDurationFromElement(this._dialog)
|
||||
EventHandler.off(this._element, TRANSITION_END)
|
||||
EventHandler.one(this._element, TRANSITION_END, () => {
|
||||
this._element.classList.remove(CLASS_NAME_STATIC)
|
||||
if (!isModalOverflowing) {
|
||||
EventHandler.one(this._element, TRANSITION_END, () => {
|
||||
this._element.style.overflowY = ''
|
||||
})
|
||||
emulateTransitionEnd(this._element, modalTransitionDuration)
|
||||
}
|
||||
})
|
||||
emulateTransitionEnd(this._element, modalTransitionDuration)
|
||||
this._element.focus()
|
||||
|
||||
Reference in New Issue
Block a user