Files
caria-website/module/@popperjs/core@2.11.8/lib/dom-utils/getWindowScrollBarX.js
Christian CUNAT-BRULE 5db1c28fd8
All checks were successful
Déploiement DEV / deploy (push) Successful in 9s
Ajout des modules
2026-08-06 20:51:00 +02:00

13 lines
721 B
JavaScript

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;
}