From 2ed3f877c31fbaf86044a20869b2b9489383512b Mon Sep 17 00:00:00 2001 From: Ajay Bura <32841439+ajbura@users.noreply.github.com> Date: Sat, 15 Feb 2025 18:58:02 +1100 Subject: [PATCH] fix editor exit button appears on room switch (#2207) --- src/app/components/editor/Toolbar.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/components/editor/Toolbar.tsx b/src/app/components/editor/Toolbar.tsx index e5c7d16..17ba6bc 100644 --- a/src/app/components/editor/Toolbar.tsx +++ b/src/app/components/editor/Toolbar.tsx @@ -257,7 +257,9 @@ export function Toolbar() { const modKey = isMacOS() ? KeySymbol.Command : 'Ctrl'; const disableInline = isBlockActive(editor, BlockType.CodeBlock); - const canEscape = isAnyMarkActive(editor) || !isBlockActive(editor, BlockType.Paragraph); + const canEscape = isBlockActive(editor, BlockType.Paragraph) + ? isAnyMarkActive(editor) + : ReactEditor.isFocused(editor); const [isMarkdown, setIsMarkdown] = useSetting(settingsAtom, 'isMarkdown'); return ( -- 2.34.1