MCPcopy Create free account
hub / github.com/Lobos/react-ui / getUnboundedScrollPosition

Function getUnboundedScrollPosition

docs/lib/react.js:18769–18780  ·  view source on GitHub ↗

* Gets the scroll position of the supplied element or window. * * The return values are unbounded, unlike `getScrollPosition`. This means they * may be negative or exceed the element boundaries (which is possible using * inertial scrolling). * * @param {DOMWindow|DOMElement} scrollable * @ret

(scrollable)

Source from the content-addressed store, hash-verified

18767 */
18768
18769function getUnboundedScrollPosition(scrollable) {
18770 if (scrollable === window) {
18771 return {
18772 x: window.pageXOffset || document.documentElement.scrollLeft,
18773 y: window.pageYOffset || document.documentElement.scrollTop
18774 };
18775 }
18776 return {
18777 x: scrollable.scrollLeft,
18778 y: scrollable.scrollTop
18779 };
18780}
18781
18782module.exports = getUnboundedScrollPosition;
18783},{}],154:[function(_dereq_,module,exports){

Callers 1

scrollValueMonitorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…