์ผ€์ด์Šค ce-0008 ยท ์‹œ๋‚˜๋ฆฌ์˜ค scenario-selection-collapse-on-blur

Selection collapses unexpectedly when clicking outside contenteditable

OS: macOS Ubuntu 22.04 ๊ธฐ๊ธฐ: Laptop Any ๋ธŒ๋ผ์šฐ์ €: Safari 120.0 ํ‚ค๋ณด๋“œ: US ์ดˆ์•ˆ
selectioncaret

์ด ํŽ˜์ด์ง€๋Š” ์•„์ง ๋ฒˆ์—ญ๋˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค

ํ˜„์žฌ ์˜์–ด ์›๋ฌธ์„ ํ‘œ์‹œํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ๋ฒˆ์—ญ์— ๊ธฐ์—ฌํ•ด ์ฃผ์‹œ๋ฉด ๊ฐ์‚ฌํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

Phenomenon

When a range of text is selected inside a contenteditable element, clicking outside the element collapses the selection to a caret position inside the editable region instead of clearing the selection entirely.

Reproduction example

  1. Focus the editable area.
  2. Type a few words across multiple lines.
  3. Drag to select part of a line or multiple lines.
  4. Click outside the editable area, for example on the page background.

Observed behavior

  • The selection collapses to a single caret position inside the editable element.
  • The range is not cleared, which can cause confusion for users relying on visual feedback.

Expected behavior

  • The selection is cleared entirely when the element loses focus, or at least behaves similarly to native text fields in the same browser and OS combination.

Notes

  • This behavior can affect keyboard shortcuts (for example, copy or delete) if they are bound to the selection state.

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: macOS Ubuntu 22.04
Device: Laptop Any
Browser: Safari 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.