Skip to content

Commit

Permalink
fix safari hidden header
Browse files Browse the repository at this point in the history
  • Loading branch information
pasyukevich committed Oct 19, 2023
1 parent 4783701 commit 6515cf5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/withViewportOffsetTop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default function withViewportOffsetTop<TProps extends ViewportOffsetTopPr

useEffect(() => {
const updateDimensions = (event: Event) => {
const targetOffsetTop = (event.target instanceof HTMLElement && event.target.offsetTop) || 0;
const targetOffsetTop = (event.target instanceof VisualViewport && event.target.offsetTop) || 0;
setViewportOffsetTop(targetOffsetTop);
};

Expand Down

0 comments on commit 6515cf5

Please sign in to comment.