How to programmatically open/close the tooltip? #328
-
I'm trying to figure out how to open the tooltip for processing "link" text when users click the link icon in the menu, but I'm not yet sure how to call one plugin from another. Is there an example of this behavior anywhere? I'm thinking there may be a way to use a command, as one can do:
Though I don't think the tooltip exposes callable commands for open/close yet. Edit: oh wow, I just learned one can use:
to gain access to all commands. I think one can use those commands to create and insert a link |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Since the tooltip is controlled by prosemirror selection. So what you need to do is just create a text selection programmatically. The transaction.setSelection API in prosemirror can help you. |
Beta Was this translation helpful? Give feedback.
Since the tooltip is controlled by prosemirror selection. So what you need to do is just create a text selection programmatically. The transaction.setSelection API in prosemirror can help you.