mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-06-08 17:22:31 +03: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
+1
-1
@@ -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