To move from the math node to prosemirror, we hook into MathQuill handlers and trigger a selection transaction and a view.focus. To go the other direction, we need to know whether we are entering the node from the left or the right. In each math node, we listen for state selection changes (via a plugin), and remember whether on the last transaction the cursor was ahead of the node or behind. Then we use that info in the selectNode callback.
3 Likes