diff --git a/surfsense_web/components/assistant-ui/inline-mention-editor.tsx b/surfsense_web/components/assistant-ui/inline-mention-editor.tsx index 40bd16f8d..66389cade 100644 --- a/surfsense_web/components/assistant-ui/inline-mention-editor.tsx +++ b/surfsense_web/components/assistant-ui/inline-mention-editor.tsx @@ -119,11 +119,13 @@ export const InlineMentionEditor = forwardRef { if (!initialText || !editorRef.current) return; + // Insert the text and add trailing line breaks for typing space editorRef.current.innerText = initialText; editorRef.current.appendChild(document.createElement("br")); editorRef.current.appendChild(document.createElement("br")); setIsEmpty(false); onChange?.(initialText, Array.from(mentionedDocs.values())); + // Place cursor at the end of the content editorRef.current.focus(); const sel = window.getSelection(); const range = document.createRange(); @@ -131,6 +133,11 @@ export const InlineMentionEditor = forwardRef