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:
authorGeoSot <geo.sotis@gmail.com>2021-10-08 03:19:18 +0300
committerXhmikosR <xhmikosr@gmail.com>2021-11-25 20:23:49 +0300
commit0f9fd75d6c7bfd850f50d6a587c54b8e1227830c (patch)
tree0914c769f8ab77d3dc262e8b948c9973baefbb9f
parentcc3e5789ecba18ccf759b60d90946a1a88ea0fa5 (diff)
Respect modal's initial overflowY
-rw-r--r--js/src/modal.js12
1 files changed, 5 insertions, 7 deletions
diff --git a/js/src/modal.js b/js/src/modal.js
index c96ad388cc..ecbf5cadca 100644
--- a/js/src/modal.js
+++ b/js/src/modal.js
@@ -296,9 +296,9 @@ class Modal extends BaseComponent {
const { classList, scrollHeight, style } = this._element
const isModalOverflowing = scrollHeight > document.documentElement.clientHeight
-
+ const initialOverflowY = style.overflowY
// return if the following background transition hasn't yet completed
- if ((!isModalOverflowing && style.overflowY === 'hidden') || classList.contains(CLASS_NAME_STATIC)) {
+ if (initialOverflowY === 'hidden' || classList.contains(CLASS_NAME_STATIC)) {
return
}
@@ -309,11 +309,9 @@ class Modal extends BaseComponent {
classList.add(CLASS_NAME_STATIC)
this._queueCallback(() => {
classList.remove(CLASS_NAME_STATIC)
- if (!isModalOverflowing) {
- this._queueCallback(() => {
- style.overflowY = ''
- }, this._dialog)
- }
+ this._queueCallback(() => {
+ style.overflowY = initialOverflowY
+ }, this._dialog)
}, this._dialog)
this._element.focus()