[csswg-drafts] [cssom-view] Fire scrollend consistently in cases where there is no scrolling. (#8218)

flackr has just created a new issue for https://github.com/w3c/csswg-drafts:

== [cssom-view] Fire scrollend consistently in cases where there is no scrolling. ==
While experimenting with the implementations of scrollend in firefox and chrome I noticed that there's [some inconsistency about in which cases it fires when no scrolling occurs](https://bugs.chromium.org/p/chromium/issues/detail?id=1400698). In particular, scrollend is fired when the user pressed an arrow key, or performs a scrolling action which results in no scroll, but is not fired when a programmatic API is used to scroll to the current location.

While I can see an ergonomic argument for strictly pairing scrollend to scroll events, I think it would be useful if we guaranteed a scrollend event will occur after scrolling API calls, enabling developers to do something after a scroll to a location without needing to detect if scroll didn't happen. e.g.

```js
function scrollToPromise(element) {
  return new Promise((resolve) => {
    window.addEventListener('scrollend', resolve);
    element.scrollIntoViewIfNeeded();
  });
}
```

@argyleink 

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8218 using your GitHub account


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

Received on Tuesday, 13 December 2022 17:29:51 UTC