From: Ajay Bura <32841439+ajbura@users.noreply.github.com> Date: Sat, 15 Feb 2025 07:58:02 +0000 (+1100) Subject: fix editor exit button appears on room switch (#2207) X-Git-Tag: v4.3.2~9 X-Git-Url: https://git.wafflesoft.org/?a=commitdiff_plain;h=2ed3f877c31fbaf86044a20869b2b9489383512b;p=rainny.git fix editor exit button appears on room switch (#2207) --- 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 (