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,5 @@
import type { ScrollPosition } from "~/types/interfaces";
export default (element: HTMLElement, scrollPosition: ScrollPosition) => {
return element.scrollTo({ top: scrollPosition.scrollTop, left: scrollPosition.scrollLeft });
}