How can I get a Bubble Menu to only appear on click? #5467
Unanswered
andersr
asked this question in
Questions & Help
Replies: 1 comment 2 replies
-
Looking at the props available for tippy.js, it seem the {editor && (
<BubbleMenu
editor={editor}
shouldShow={({ editor }) => editor.isActive("link")}
tippyOptions={{
trigger: "click",
triggerTarget: ??? // <-- this requires the target Element, can get the current position and Node, but not sure about element
}}
>
<div>MY MENU</div>
</BubbleMenu>)} |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am currently working to add a menu that should appear on click of a link in the editor. I'm trying to use the BubbleMenu extension for this.
While it does appear on click of a link, it ALSO appears, for example, if I move my cursor so it is on a link, which I would like to prevent. It also will appear on focus of the editor if the last element happens to be a link, which I also want to prevent. Is there some way to have a BubbleMenu only appear on click?
This is what I currently have:
There is a
handleClick
method ineditorProps
in theuseEditor
hook. However, I am not clear how I would bind that handler toshouldShow
.Any tips or insights would be appreciated!
Beta Was this translation helpful? Give feedback.
All reactions