Skip to content

Commit

Permalink
Merge pull request #119 from getcronit/main
Browse files Browse the repository at this point in the history
fix: handle optional chaining for offsetTop in scroll.ts
  • Loading branch information
schettn authored Jun 10, 2024
2 parents cb70c20 + 0d0042b commit 4146e90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/hooks/scroll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const useScrollShow = (

const scrollPositionRelativeToRef =
target.documentElement.scrollTop -
(offsetTop ? offsetTop : ref.current!.offsetTop) -
(offsetTop ? offsetTop : ref.current?.offsetTop || 0) -
(noScroll ? 999999999 : offset)

if (!display && scrollPositionRelativeToRef >= 0) {
Expand Down

0 comments on commit 4146e90

Please sign in to comment.