Merge pull request #254 from multica-ai/NevilleQingNY/sync-remote
fix(web): delay TitleEditor autofocus for Dialog animation
This commit is contained in:
commit
fe963d672d
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