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