feat: implement scroll position retention

This commit is contained in:
SauceyRed 2025-06-07 06:03:54 +02:00
parent 6363a6eac1
commit f5d4e0d011
4 changed files with 59 additions and 1 deletions

View file

@ -0,0 +1,14 @@
import type { ScrollPosition } from "~/types/interfaces";
export default (element: HTMLElement): ScrollPosition => {
return {
scrollHeight: element.scrollHeight,
scrollWidth: element.scrollWidth,
scrollTop: element.scrollTop,
scrollLeft: element.scrollLeft,
offsetHeight: element.offsetHeight,
offsetWidth: element.offsetWidth,
offsetTop: element.offsetTop,
offsetLeft: element.offsetLeft
};
}