Re: [csswg-drafts] [css-scroll-snap] Programmatically scroll to snap points (#8558)

@fantasai You're right. `scrollIntoView()` with the `block` and `inline` options would get you close here. I still think you have to retrieve and parse the computed `scroll-snap-align` property of the element to figure out which options you should call `scrollIntoView()` with?

Maybe a new value for [ScrollLogicalPosition](https://drafts.csswg.org/cssom-view/#enumdef-scrolllogicalposition) could make this more ergonomic?

```js
element.scrollIntoView({block: 'snap'})
```

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


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

Received on Sunday, 4 August 2024 09:03:41 UTC