source: imaps-frontend/node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js.flow

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: 754 bytes
Line 
1// @flow
2import getBoundingClientRect from './getBoundingClientRect';
3import getDocumentElement from './getDocumentElement';
4import getWindowScroll from './getWindowScroll';
5
6export default function getWindowScrollBarX(element: Element): number {
7 // If <html> has a CSS width greater than the viewport, then this will be
8 // incorrect for RTL.
9 // Popper 1 is broken in this case and never had a bug report so let's assume
10 // it's not an issue. I don't think anyone ever specifies width on <html>
11 // anyway.
12 // Browsers where the left scrollbar doesn't cause an issue report `0` for
13 // this (e.g. Edge 2019, IE11, Safari)
14 return (
15 getBoundingClientRect(getDocumentElement(element)).left +
16 getWindowScroll(element).scrollLeft
17 );
18}
Note: See TracBrowser for help on using the repository browser.