Skip to content

Commit

Permalink
0px if not browser
Browse files Browse the repository at this point in the history
  • Loading branch information
mayaraman19 committed Sep 18, 2024
1 parent 2c766d3 commit 9cf6857
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/hooks/useViewport.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ export function getViewport() {
scrollY: Math.max(window.pageYOffset, document.documentElement.scrollTop, document.body.scrollTop || 0),
scrollX: Math.max(window.pageXOffset, document.documentElement.scrollLeft, document.body.scrollLeft || 0),
}
: {};
: {
scrollY: 0,
scrollX: 0,
};

return viewport;
}
Expand Down

0 comments on commit 9cf6857

Please sign in to comment.