Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo-mod-jslibs-dist.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'popperjs/package/dist/esm/dom-utils/getWindowScrollBarX.js')
-rw-r--r--popperjs/package/dist/esm/dom-utils/getWindowScrollBarX.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/popperjs/package/dist/esm/dom-utils/getWindowScrollBarX.js b/popperjs/package/dist/esm/dom-utils/getWindowScrollBarX.js
new file mode 100644
index 0000000..b650d94
--- /dev/null
+++ b/popperjs/package/dist/esm/dom-utils/getWindowScrollBarX.js
@@ -0,0 +1,13 @@
+import getBoundingClientRect from "./getBoundingClientRect.js";
+import getDocumentElement from "./getDocumentElement.js";
+import getWindowScroll from "./getWindowScroll.js";
+export default function getWindowScrollBarX(element) {
+ // If <html> has a CSS width greater than the viewport, then this will be
+ // incorrect for RTL.
+ // Popper 1 is broken in this case and never had a bug report so let's assume
+ // it's not an issue. I don't think anyone ever specifies width on <html>
+ // anyway.
+ // Browsers where the left scrollbar doesn't cause an issue report `0` for
+ // this (e.g. Edge 2019, IE11, Safari)
+ return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
+} \ No newline at end of file