diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx index 3918fdac40..c50ef32168 100644 --- a/apps/web/src/components/ChatView.tsx +++ b/apps/web/src/components/ChatView.tsx @@ -1246,12 +1246,12 @@ export default function ChatView() { const next = replaceTextRange(promptRef.current, rangeStart, rangeEnd, replacement); promptRef.current = next.text; setPrompt(next.text); + setComposerCursor(next.cursor); window.requestAnimationFrame(() => { const textarea = textareaRef.current; if (!textarea) return; textarea.focus(); textarea.setSelectionRange(next.cursor, next.cursor); - setComposerCursor(next.cursor); }); }, [],