diff --git a/gui/src/components/mainInput/TipTapEditor.tsx b/gui/src/components/mainInput/TipTapEditor.tsx index 159250278..186fa533e 100644 --- a/gui/src/components/mainInput/TipTapEditor.tsx +++ b/gui/src/components/mainInput/TipTapEditor.tsx @@ -369,14 +369,21 @@ function TipTapEditor(props: TipTapEditorProps) { }; }, []); + + // IDE event listeners useEffect(() => { if (!props.isMainInput) { return; } - if (editor && document.hasFocus()) { + + if (editor) { editor.commands.focus(); + setTimeout(() => { + editor.commands.blur(); + }, 0); } + const handler = async (event: any) => { if (!editor) return;