- PM selection anchor pos:
- window.getSelection().anchorOffset
- window.getSelection().anchorNode
Instructions
- Clear contents of Editor
- Type a single character (i.e. "a")
- (don't click to prevent focus loss)
- A transaction is dispatched to tr.replaceWith(1, doc.nodeSize - 2, nodes), where nodes are:
- An inline node (dinosaur rendered as img)
- A text node with text of " " (a single space)
Expected (ok for Safari and Firefox)
The cursor is at position 3, after the dinosaur and after the single space
Actual (on Chrome version >= 61.*)
The prosemirror cursor is at position 3, but browser cursor is at position 2
- Additionally, try pressing RIGHT ARROW
- The browser cursor moves right (to correct position)
- A new PM transaction is not applied, because the selection is already valid (?)