feat: implement scroll position retention

This commit is contained in:
SauceyRed 2025-06-07 06:03:54 +02:00
parent acca8468f0
commit 010472c83d
Signed by: sauceyred
GPG key ID: 270B096EF6E9A462
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 });
}