start at /dashboard, focus cursor after clipboard text

This commit is contained in:
CREDO23 2026-03-25 16:08:39 +02:00
parent 91ad36027d
commit 4a5a28805d
2 changed files with 9 additions and 2 deletions

View file

@ -119,9 +119,16 @@ export const InlineMentionEditor = forwardRef<InlineMentionEditorRef, InlineMent
useEffect(() => {
if (!initialText || !editorRef.current) return;
editorRef.current.textContent = initialText;
editorRef.current.textContent = initialText + "\n";
setIsEmpty(false);
onChange?.(initialText, Array.from(mentionedDocs.values()));
editorRef.current.focus();
const sel = window.getSelection();
const range = document.createRange();
range.selectNodeContents(editorRef.current);
range.collapse(false);
sel?.removeAllRanges();
sel?.addRange(range);
}, [initialText]); // eslint-disable-line react-hooks/exhaustive-deps
// Focus at the end of the editor