Hello, I’ve been working on implementing MathQuill inside Prosemirror. In doing so, I tripped over some strange behavior when MathQuill is focused and I’m trying to select something in Prosemirror:
- Click inside PM: Transaction fired, cursor appears as expected.
- Click inside MQ: Focus event fired.
selectNode
fired. Transaction fired. Cursor appears in MQ as expected. - Click inside PM: Nothing appears to happen.
- Click inside PM:
deselectNode
fired. Transaction fired. Cursor appears in PM as expected.
Here’s a minimal example on Glitch. Try clicking inside the MathQuill box and then clicking on the surrounding paragraph text.
I talked to Denis (who created the original Prosemirror/MathQuill integration) and we found out that when I removed the ‘atom’ flag from the Node, the whole thing worked fine. But when we read the documentation, ‘atom’ seems appropriate for this node:
atom: ?bool
Can be set to true to indicate that, though this isn’t a leaf node, it doesn’t have directly editable content and should be treated as a single unit in the view.
I’m just curious why ‘atom’ breaks the NodeView in this way? Are you not supposed to mark a Node as an ‘atom’ if it has a NodeView?