Add callback function after scroll is ended
Example focus on input after scrolling
maybe specifying a duration and using a setTimeout function is good enough
A callback has a lot of use cases indeed.
I would say any animation library should expose a life cycle methods eg: before-animation after-animation etc.. but a callback for a done animation is a great start.
@flyingant
I've noticed that react-scroll-to-component uses scroll-to behind the scenes.
scroll-to uses tween.js, and i came across this comment.
So i guess this is "doable" 😃
All we need to do is:
const cb = scrollToComponent(this.ref);
cb.on('end', () => console.log('animation is done!'));
@sag1v Yes, of course. it's native supported. I will put some examples to the demo.