Skip to content

Commit

Permalink
conditionally call scroll into view
Browse files Browse the repository at this point in the history
  • Loading branch information
Eitan Elbaz committed Jun 27, 2023
1 parent 9b46376 commit 2eab05a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/Step/Step.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const Step = React.memo(
setAnchorBoundaries((anchorElement ?? element).getBoundingClientRect());
}, [element, anchorElement]);
const scrollToElement = useCallback(() => {
element.scrollIntoView(scrollIntoViewOptions);
element?.scrollIntoView?.(scrollIntoViewOptions);
adjustBoundaries();
}, [adjustBoundaries, element, scrollIntoViewOptions]);
useEffect(() => {
Expand Down

0 comments on commit 2eab05a

Please sign in to comment.