fix(web): delay TitleEditor autofocus to avoid Dialog animation conflict
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
c6e67bd41e
commit
946b4a277e
1 changed files with 5 additions and 3 deletions
|
|
@ -117,11 +117,13 @@ const TitleEditor = forwardRef<TitleEditorRef, TitleEditorProps>(
|
|||
},
|
||||
});
|
||||
|
||||
// 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]);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue