Fall ce-0012 · Szenario scenario-caret-position-after-paste

Caret position jumps unexpectedly after pasting content

OS: Windows 11 Gerät: Desktop or Laptop Any Browser: Firefox 120.0 Tastatur: US Entwurf
pastecaretpositionfirefox

Diese Seite wurde noch nicht übersetzt

Derzeit wird der englische Originalinhalt angezeigt. Wir freuen uns über Ihre Hilfe bei der Übersetzung.

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

  1. Create a contenteditable div with some existing text.
  2. Place the caret in the middle of the text.
  3. Paste content (Ctrl+V or Cmd+V).
  4. 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.

Playground for this case

Use the reported environment as a reference and record what happens in your environment while interacting with the editable area.

Reported environment
OS: Windows 11
Device: Desktop or Laptop Any
Browser: Firefox 120.0
Keyboard: US
Your environment

Use this editable area to reproduce the described case.

Event log
Use this log together with the case description when filing or updating an issue.
0 events
Interact with the editable area to see events here.