Skip to content

Commit 7dd24ef

Browse files
authored
fix: hotKey cmd + a shows the tooltip (#422)
1 parent 1fa5c90 commit 7dd24ef

File tree

1 file changed

+11
-2
lines changed
  • src/extensions/behavior/SelectionContext

1 file changed

+11
-2
lines changed

src/extensions/behavior/SelectionContext/index.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
import {keydownHandler} from 'prosemirror-keymap';
2-
import {type EditorState, Plugin, type PluginSpec, TextSelection} from 'prosemirror-state';
2+
import {
3+
AllSelection,
4+
type EditorState,
5+
Plugin,
6+
type PluginSpec,
7+
TextSelection,
8+
} from 'prosemirror-state';
39
import type {EditorProps, EditorView} from 'prosemirror-view';
410

511
import {ActionStorage, ExtensionAuto} from '../../../core';
@@ -102,7 +108,10 @@ class SelectionTooltip implements PluginSpec<unknown> {
102108

103109
const {selection} = state;
104110
// Hide the tooltip if the selection is empty
105-
if (selection.empty || !(selection instanceof TextSelection)) {
111+
if (
112+
selection.empty ||
113+
!(selection instanceof TextSelection || selection instanceof AllSelection)
114+
) {
106115
this.tooltip.hide(view);
107116
return;
108117
}

0 commit comments

Comments
 (0)