diff --git a/src/app/playground/Playground.tsx b/src/app/playground/Playground.tsx index ce1a38cc..065e9e92 100644 --- a/src/app/playground/Playground.tsx +++ b/src/app/playground/Playground.tsx @@ -1,6 +1,6 @@ 'use client'; -import { FunctionComponent } from 'react'; +import { FunctionComponent, useEffect } from 'react'; import { CollapsibleJsonViewer } from '../../client/components/common/CodeSnippet/CodeSnippet'; import dynamic from 'next/dynamic'; import SignalTable, { TableCellData } from './components/SignalTable'; @@ -75,6 +75,13 @@ function Playground() { serverError, } = usePlaygroundSignals(); + /** + * Prevent restoring scroll position on page refresh since there is nothing to scroll to while the data is being loaded + */ + useEffect(() => { + window.history.scrollRestoration = 'manual'; + }, []); + if (agentError) { return JavaScript Agent Error: {agentError.message}.; }