Skip to content

Commit

Permalink
fix: Only scroll to start node on initial load of flow (#3986)
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr authored Nov 20, 2024
1 parent 6647d3a commit 7c5a73a
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ const EndPoint: React.FC<{ text: string }> = ({ text }) => {

useEffect(() => {
if (isStart && el.current) {
// Only scroll to center on initial visit
const storageKey = ["scrollPos", currentPath].join(":");
const hasVisited = sessionStorage.getItem(storageKey);
if (hasVisited) return;

if (isLoading) return;

scrollIntoView(
Expand Down

0 comments on commit 7c5a73a

Please sign in to comment.