Let’s take the official tooltip example as a base: https://prosemirror.net/examples/tooltip/
Once a selection is made, a tooltip is rendered thanks to a Prosemirror plugin. Now, if you click outside of the editor, this last lose the focus but the tooltip remains visible.
My question is about the recommended manner to detect the editor blur event from plugins so that the tooltip could be hidden on editor blur if we consider the previous example.
What would be the recommended manner? I was thinking about catching the blur event at the editor level by registering a listener with handleDOMEvents and upon event to send a second event that plugins have previously registered for. Is there a better approach?