diff --git a/packages/client/src/tiptap/editor/views/bubble-menu/bubble-menu-plugin.tsx b/packages/client/src/tiptap/editor/views/bubble-menu/bubble-menu-plugin.tsx index 10a1a488..07fdacbe 100644 --- a/packages/client/src/tiptap/editor/views/bubble-menu/bubble-menu-plugin.tsx +++ b/packages/client/src/tiptap/editor/views/bubble-menu/bubble-menu-plugin.tsx @@ -11,11 +11,11 @@ export interface BubbleMenuPluginProps { shouldShow?: | ((props: { editor: Editor; - view: EditorView; - state: EditorState; + view?: EditorView; + state?: EditorState; oldState?: EditorState; - from: number; - to: number; + from?: number; + to?: number; }) => boolean) | null; renderContainerSelector?: string; @@ -114,6 +114,14 @@ export class BubbleMenuView { return; } + const shouldShow = + this.editor.isEditable && + this.shouldShow?.({ + editor: this.editor, + }); + + if (shouldShow) return; + this.hide(); };