diff --git a/packages/app/src/components/prompt-input.tsx b/packages/app/src/components/prompt-input.tsx index a5655902a47..2de83515df6 100644 --- a/packages/app/src/components/prompt-input.tsx +++ b/packages/app/src/components/prompt-input.tsx @@ -250,6 +250,16 @@ export const PromptInput: Component = (props) => { const isFocused = createFocusSignal(() => editorRef) + // tauri/wkwebview doesn't always remove cursor when focus moves to another element + createEffect(() => { + if (!isFocused() && document.activeElement !== editorRef) { + const selection = window.getSelection() + if (selection && editorRef.contains(selection.anchorNode)) { + selection.removeAllRanges() + } + } + }) + createEffect(() => { params.id editorRef.focus()