main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 2 weeks ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
721 bytes
|
Line | |
---|
1 | import getBoundingClientRect from "./getBoundingClientRect.js";
|
---|
2 | import getDocumentElement from "./getDocumentElement.js";
|
---|
3 | import getWindowScroll from "./getWindowScroll.js";
|
---|
4 | export default function getWindowScrollBarX(element) {
|
---|
5 | // If <html> has a CSS width greater than the viewport, then this will be
|
---|
6 | // incorrect for RTL.
|
---|
7 | // Popper 1 is broken in this case and never had a bug report so let's assume
|
---|
8 | // it's not an issue. I don't think anyone ever specifies width on <html>
|
---|
9 | // anyway.
|
---|
10 | // Browsers where the left scrollbar doesn't cause an issue report `0` for
|
---|
11 | // this (e.g. Edge 2019, IE11, Safari)
|
---|
12 | return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
|
---|
13 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.