diff --git a/docs/src/routes/playground/index.tsx b/docs/src/routes/playground/index.tsx index 506904891..82af16758 100644 --- a/docs/src/routes/playground/index.tsx +++ b/docs/src/routes/playground/index.tsx @@ -151,6 +151,7 @@ export default function Playground() { const [monaco, setMonaco] = createSignal(); const [codeEditor, setCodeEditor] = createSignal(); + const [isMounted, setIsMounted] = createSignal(false); const [editorLoading, setEditorLoading] = createSignal(true); const [editorError, setEditorError] = createSignal(); const [formatShortcut, setFormatShortcut] = createSignal("Ctrl S"); @@ -199,6 +200,10 @@ export default function Playground() { return flattened; }); + const isPlaygroundReady = createMemo( + () => isMounted() && !editorLoading() && runState() !== "loading", + ); + const setFailure = (message: string) => { setRunState("error"); setStatusMessage(message); @@ -679,6 +684,8 @@ export default function Playground() { ); }); + onMount(() => setIsMounted(true)); + onMount(() => { let disposed = false; let editor: MonacoEditor.IStandaloneCodeEditor | undefined; @@ -927,10 +934,13 @@ export default function Playground() { og_url={`${DEFAULT_URL}playground`} /> -
+
+ + + + + {(menu) => (