From 8f2b7021a676fdf9db7393ff9a3a43b8565b448c Mon Sep 17 00:00:00 2001 From: Jason Jacobs Date: Wed, 21 Feb 2024 13:57:23 -0800 Subject: [PATCH] There seems to be a bug in tip-tap that the cursor doesn't come up initially and waits for a blur event meaning a user won't have a cursor unless some other screen gets focus. this forces the blur on initialization causing the no curser issue to go away (#881) --- gui/src/components/mainInput/TipTapEditor.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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;