Everything worked well till I changed tags.atom = true. After tags become atom, even when the input is under focus, prosemirror editor will handle the keyboard event and insert what I type in the input box into the same line of the document. I tried stopPropagation() in both the keyup and keydown events, but doesn’t work.
The reason I want it to be atom is that I want it to work with the gapCursor().
But I don’t know how to move the cursor away from this node. right now, a user has to manually click other paragraphs to dismiss the selection of this node:
I can’t seem to get the position correct. This moves the cursor to a strange place (not the previous paragraph.) Although the current node is losing focus, I still can’t type anything.
using the ResolvedPos also doesn’t seem to work too:
node.resolve(0);
if I check its nodeBefore and nodeAfter, I will get null. If I check its parent, I will get the same node back i.e. the “tags” node.
I expect it to return the paragraph node before the tags node, so that I can query the paragraph node’s last possible cursor position and change the selection to that location.