fix editor exit button appears on room switch (#2207)
authorAjay Bura <32841439+ajbura@users.noreply.github.com>
Sat, 15 Feb 2025 07:58:02 +0000 (18:58 +1100)
committerGitHub <noreply@github.com>
Sat, 15 Feb 2025 07:58:02 +0000 (18:58 +1100)
src/app/components/editor/Toolbar.tsx

index e5c7d16e744b6a44e113599dd88ec01534810079..17ba6bc2fd765f67f6ee0dff55248ec0a1a1030e 100644 (file)
@@ -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 (