mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-26 06:44:35 +02:00
HTMLElement.offset* by getBoundingClientRect() (#21788)
* Replace element.offet* by getBoundingClientRect() * Use variable to store BoundingClientRect * Fix cc issue...
This commit is contained in:
committed by
Mark Otto
parent
f2f2e39a45
commit
275821bbb0
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user