]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Avoid bad scrollbar replacement into width values (#30690)
authorJohann-S <johann.servoire@gmail.com>
Wed, 29 Apr 2020 19:28:20 +0000 (21:28 +0200)
committerXhmikosR <xhmikosr@gmail.com>
Sat, 2 May 2020 12:39:19 +0000 (15:39 +0300)
js/src/modal.js

index 6b80bb2f0dfde3d33f56caa9a5d710d7945ded37..8e505eda967496d056f1456b796e7d8df0f746e3 100644 (file)
@@ -455,8 +455,11 @@ class Modal {
   }
 
   _checkScrollbar() {
-    const rect = document.body.getBoundingClientRect()
-    this._isBodyOverflowing = rect.left + rect.right < window.innerWidth
+    const {
+      left, right
+    } = document.body.getBoundingClientRect()
+
+    this._isBodyOverflowing = Math.floor(left + right) < window.innerWidth
     this._scrollbarWidth = this._getScrollbarWidth()
   }