Re: [csswg-drafts] [cssom-view-1] Option for scrollIntoView that doesn't propagate to root (#9452)

I propose we go with option 1, and for flexibility add a container option to [ScrollIntoViewOptions](https://www.w3.org/TR/cssom-view-1/#dictdef-scrollintoviewoptions):

```
dictionary ScrollIntoViewOptions : [ScrollOptions](https://www.w3.org/TR/cssom-view-1/#dictdef-scrolloptions) {
  ScrollLogicalPosition block = "center";
  ScrollLogicalPosition inline = "center";
  Element? container = null,
};
```

By default, the null container will scroll all scroll containers all the way to the root, however if container is specified, it will only scroll the containers from the target element up to container inclusive.

Additionally, I think it would be useful to add [scrollParent](https://github.com/w3c/csswg-drafts/issues/1522) so that you could easily get the scroll container for the target, e.g.

```js
target.scrollIntoView({container: target.scrollParent});
```

-- 
GitHub Notification of comment by flackr
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9452#issuecomment-2451830838 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 1 November 2024 12:57:34 UTC