Is it possible to emulate a callback or async behaviour on window.scrollTo in vanilla JS or React?
Pseudo code example:
window.scrollTo({ top: 0, left: 0, behavior: 'smooth').then(() => {
console.log('The browser has finished scrolling')
})
This question has an apparently working solution in Angular, but I was unable to replicate it.