[w3c/editing] Selection updates from Web APIs should scroll to reveal selection in scrollable containers (Issue #526)

shwetabin created an issue (w3c/editing#526)


Current spec doesn't define whether setting selection through Web APIs should scroll to reveal the selection. 

## Case: Caret in scrollable container

```html
<div style="width: 200px; height: 50px; overflow: auto;">
  <p>Line 1</p>
  <p>Line 2</p>
  <p id="target">Line 3 - below fold</p>
</div>
```
```js
selection.collapse(target.firstChild, 5);
```
Browser behaviors:
Chromium -  No scroll, caret not visible
Safari - No scroll, caret not visible 
Firefox - Scrolls to reveal caret ✓

Proposed Behaviour

Selection should scroll the closest scrollable ancestor to reveal the selection.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/editing/issues/526
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/editing/issues/526@github.com>

Received on Tuesday, 10 February 2026 06:40:41 UTC