@mantine/hooks
Version:
A collection of 50+ hooks for state and UI management
18 lines (15 loc) • 439 B
JavaScript
'use client';
;
const getScrollStart = ({ axis, parent }) => {
if (!parent && typeof document === "undefined") {
return 0;
}
const method = axis === "y" ? "scrollTop" : "scrollLeft";
if (parent) {
return parent[method];
}
const { body, documentElement } = document;
return body[method] + documentElement[method];
};
exports.getScrollStart = getScrollStart;
//# sourceMappingURL=get-scroll-start.cjs.map