[Bug]: BubbleMenu extension prop shouldShow
is never called
#6147
Labels
Category: Open Source
The issue or pull reuqest is related to the open source packages of Tiptap.
Type: Bug
The issue or pullrequest is related to a bug
Affected Packages
@tiptap/extension-bubble-menu
Version(s)
2.11.5 (latest)
Bug Description
I noticed that the
shouldShow
property of the extension configuration does not work properly.It is never called and therefore even returning
false
as no effect and the BubbleMenu will be always shown.Example:
Browser Used
Firefox
Code Example URL
https://codesandbox.io/p/sandbox/tiptap-bubblemenu-bug-y65ccv
Expected Behavior
If
false
is returned byshouldShow
, then the BubbleMenu must not be displayed.Additional Context (Optional)
If someone else encounters this issue, a possible workaround is to apply the
shouldShow
property to the BubbleMenu directly:In addition you may want to use some conditions from here to further enhance the workaround:
https://github.com/ueberdosis/tiptap/blob/develop/packages/extension-bubble-menu/src/bubble-menu-plugin.ts#L86-L105
Dependency Updates
The text was updated successfully, but these errors were encountered: