diff --git a/packages/extension-floating-menu/src/floating-menu-plugin.ts b/packages/extension-floating-menu/src/floating-menu-plugin.ts index e014455fa..fce0ff529 100644 --- a/packages/extension-floating-menu/src/floating-menu-plugin.ts +++ b/packages/extension-floating-menu/src/floating-menu-plugin.ts @@ -33,7 +33,7 @@ export class FloatingMenuView { public tippyOptions?: Partial - public shouldShow: Exclude = ({ state }) => { + public shouldShow: Exclude = ({ state, view }) => { const { selection } = state const { $anchor, empty } = selection const isRootDepth = $anchor.depth === 1 @@ -41,6 +41,10 @@ export class FloatingMenuView { && !$anchor.parent.type.spec.code && !$anchor.parent.textContent + if (!view.hasFocus()) { + return false + } + if (!empty || !isRootDepth || !isEmptyTextBlock) { return false }