Phenomenon
After pasting content into a contenteditable region, the caret position does not end up at the expected location, sometimes jumping to the beginning of the pasted content or to an unexpected position.
Reproduction example
- Create a contenteditable div with some existing text.
- Place the caret in the middle of the text.
- Paste content (Ctrl+V or Cmd+V).
- Observe the final caret position.
Observed behavior
- In Firefox on Windows, the caret sometimes ends up at the start of the pasted content instead of after it.
- The selection range after paste is inconsistent.
Expected behavior
- The caret should be positioned immediately after the pasted content.