handleClick vs handleDOMEvents

Hi there,

Imagine that I have a mention extension on my editor, and mentions added to the editor are of a particular node type with some data-* attributes. I want to be able to detect user clicks on the editor mentions, and be able to extract information from the data-* attributes, and then show an information popover about the mentioned user.

I believe I can achieve this with both handleClick and handleDOMEvents, but I’m wondering which would be the more appropriate one? Thoughts?

1 Like

Basically, handleClick works in terms of ProseMirror document nodes, and handleDOMEvents works with raw DOM events and DOM nodes. Use whichever is more convenient for your use case.

1 Like

Since I want to handle clicks on custom ProseMirror nodes, it looks like handleClick is more appropriate based on your reply. Thank you, @marijn :+1: