Skip to content

The open source coding agent.

TypeScript

fix(app): Edit-project name race condition (#9551)

DNGriffin1f3b2b59518d
diff --git a/packages/app/src/pages/layout.tsx b/packages/app/src/pages/layout.tsx
index 683b24c52c7..adebdac3e7f 100644
--- a/packages/app/src/pages/layout.tsx
+++ b/packages/app/src/pages/layout.tsx
@@ -152,7 +152,6 @@ export default function Layout(props: ParentProps) {
const openEditor = (id: string, value: string) => {
if (!id) return
setEditor({ active: id, value })
- queueMicrotask(() => editorRef.current?.focus())
}
const closeEditor = () => setEditor({ active: "", value: "" })
@@ -221,6 +220,7 @@ export default function Layout(props: ParentProps) {
<InlineInput
ref={(el) => {
editorRef.current = el
+ requestAnimationFrame(() => el.focus())
}}
value={editorValue()}
class={props.class}