From 77a898186f4fbdac6f8d6d91dad70dd40b5d9faa Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Wed, 21 Feb 2024 14:20:12 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20settimeout=20blur?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gui/src/components/mainInput/TipTapEditor.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gui/src/components/mainInput/TipTapEditor.tsx b/gui/src/components/mainInput/TipTapEditor.tsx index 186fa533e..a2ffae568 100644 --- a/gui/src/components/mainInput/TipTapEditor.tsx +++ b/gui/src/components/mainInput/TipTapEditor.tsx @@ -369,19 +369,18 @@ function TipTapEditor(props: TipTapEditorProps) { }; }, []); - - // IDE event listeners useEffect(() => { if (!props.isMainInput) { return; } - if (editor) { + if (editor && document.hasFocus()) { editor.commands.focus(); setTimeout(() => { + // https://github.com/continuedev/continue/pull/881 editor.commands.blur(); - }, 0); + }, 0); } const handler = async (event: any) => {