W3C home > Mailing lists > Public > public-css-archive@w3.org > December 2019

Re: [csswg-drafts] [cssom-view-1] Provide onAnimationEnd callback in scrollIntoView options (#3744)

From: Daniel Tonon via GitHub <sysbot+gh@w3.org>
Date: Thu, 12 Dec 2019 02:28:02 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-564821823-1576117681-sysbot+gh@w3.org>
Is there any chance of `element.scrollIntoView` and `window.scroll` returning a promise that resolves when the scroll animation has ended? Or is that going to break backwards compatibility?

Applied to `element.scrollIntoView`

```js
element.scrollIntoView({ behavior: 'smooth', block: 'start').then( scrollEvent => {
  console.log('The browser has finished scrolling')
})
```

Applied to `window.scroll`

```js
window.scroll({ top: 0, left: 0, behavior: 'smooth'}).then( scrollEvent => {
  console.log('The browser has finished scrolling')
})
```

-- 
GitHub Notification of comment by Dan503
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3744#issuecomment-564821823 using your GitHub account
Received on Thursday, 12 December 2019 02:28:04 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:57 UTC