Cursor Drawn At Incorrect Offset After Inserting Atom Node

Hi there! I wanted to post here to highlight a bug some of our users have encountered where the editor becomes confused about the offset of an atom node and the cursor is drawn in the incorrect position. I am able to reproduce this bug in the ProseMirror dino example using the following steps:

  1. In the third line of text (“Dinosaur nodes can be selected, copied, pasted, dragged, and so on.”), highlight and delete “Dinosaur nodes” but do not delete the space following this text.
  2. Copy and paste a dinosaur node at the beginning of this line.
  3. Move the cursor to the right using the arrow keys; it will get “caught” on the first non-space character. Deleting will remove the first non-space character even though it appears that delete should remove the space. Additionally, the text can only be highlighted to the second-to-last character.

See recordings below: improper offset improper offset highlight

Olivia Sztanga, Asana

The cursor is drawn by the browser, so I’d need to know which browser you are testing with (I’m not seeing this in Firefox and Chrome).

Thanks for the quick reply. That’s interesting! I’m able to reproduce on Chrome Version 97.0.4692.71. It does not appear to be an issue on Safari not Firefox.

I’m still not able to reproduce this—tried with Chrome 96 and 98. Can you give me the precise sequence of keys you press after pasting the dino node? I just pressed the right arrow, and my cursor moved as expected.

Sorry for the delay here. Attached, please find a gif of the bug I’m seeing. In the bottom left corner of the gif, you’ll be able to see a cast of my keystrokes. Atom Node Offset Bug