From 946b4a277e91d93178edaa092c1edb581af3350e Mon Sep 17 00:00:00 2001 From: Naiyuan Qing <145280634+NevilleQingNY@users.noreply.github.com> Date: Wed, 1 Apr 2026 14:15:31 +0800 Subject: [PATCH] fix(web): delay TitleEditor autofocus to avoid Dialog animation conflict Co-Authored-By: Claude Opus 4.6 (1M context) --- apps/web/components/common/title-editor.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/web/components/common/title-editor.tsx b/apps/web/components/common/title-editor.tsx index 14837b27..05b99ca6 100644 --- a/apps/web/components/common/title-editor.tsx +++ b/apps/web/components/common/title-editor.tsx @@ -117,11 +117,13 @@ const TitleEditor = forwardRef( }, }); - // Auto-focus after mount + // Auto-focus after mount — delay to wait for Dialog open animation useEffect(() => { if (autoFocus && editor) { - // Move cursor to end - editor.commands.focus("end"); + const timer = setTimeout(() => { + editor.commands.focus("end"); + }, 50); + return () => clearTimeout(timer); } }, [autoFocus, editor]);