aboutsummaryrefslogtreecommitdiff
path: root/js/src/modal.js
diff options
context:
space:
mode:
authorPierre Vanduynslager <[email protected]>2017-03-18 21:24:54 -0400
committerMark Otto <[email protected]>2017-03-18 18:24:54 -0700
commit275821bbb081890ffe232d50d4778eb15bdb1d7b (patch)
tree79d6a99cb89d449f75a26cf401a1dac6913eeda9 /js/src/modal.js
parentf2f2e39a45039658c3ed7a39af834ca8dd802bdc (diff)
downloadbootstrap-275821bbb081890ffe232d50d4778eb15bdb1d7b.tar.xz
bootstrap-275821bbb081890ffe232d50d4778eb15bdb1d7b.zip
HTMLElement.offset* by getBoundingClientRect() (#21788)
* Replace element.offet* by getBoundingClientRect() * Use variable to store BoundingClientRect * Fix cc issue...
Diffstat (limited to 'js/src/modal.js')
-rw-r--r--js/src/modal.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/js/src/modal.js b/js/src/modal.js
index 213434f77..9263efd53 100644
--- a/js/src/modal.js
+++ b/js/src/modal.js
@@ -450,7 +450,7 @@ const Modal = (($) => {
const scrollDiv = document.createElement('div')
scrollDiv.className = ClassName.SCROLLBAR_MEASURER
document.body.appendChild(scrollDiv)
- const scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
+ const scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth
document.body.removeChild(scrollDiv)
return scrollbarWidth
}