feat: implement scroll position retention
This commit is contained in:
parent
acca8468f0
commit
010472c83d
4 changed files with 59 additions and 1 deletions
5
utils/setScrollPosition.ts
Normal file
5
utils/setScrollPosition.ts
Normal 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 });
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue