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

You can add a [transitionend](https://developer.mozilla.org/en-US/docs/Web/API/Element/transitionend_event) event listener. This worked for me, though sometimes I get multiple callbacks for a single scroll (workaround could be for the event listener to detach itself).
```
const element = document.getElementById("element");
element.scrollIntoView({ behavior: "smooth" });
element.addEventListener("transitionend", function() {
  console.log("Scrolling finished");
});
```

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


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

Received on Friday, 10 February 2023 23:28:52 UTC