Skip to content

Commit

Permalink
Avoid bad scrollbar replacement into width values (#30690)
Browse files Browse the repository at this point in the history
  • Loading branch information
Johann-S committed Apr 29, 2020
1 parent ed2caa5 commit 85c4788
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions js/src/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand Down

0 comments on commit 85c4788

Please sign in to comment.