Avoid bad scrollbar replacement into width values (#30690)

This commit is contained in:
Johann-S 2020-04-29 21:28:20 +02:00 committed by GitHub
parent ed2caa5117
commit 85c4788ded
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -442,8 +442,9 @@ 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()
}