There were a few ways to go about this, but I decided to start with generalizing the tweening of values, then making the minimal change to allow scrollToY to take the scrolling element as an argument.
Another approach would be to add an animated scrollTo on ScrollView components, but that wouldn't help with non-constelation nodes.
It also might be valuable to export the abstracted tweenValue function, but I don't think that necessarily belongs in a dom module.
Also... since the easing isn't as predictable as a time-clamped version, it might be useful to allow a finalCallback or pass a isDone boolean to the callback when the tweening is done. The first option is arguably cleaner but having two function arguments that do similar things might be odd.
There were a few ways to go about this, but I decided to start with generalizing the tweening of values, then making the minimal change to allow
scrollToY
to take the scrolling element as an argument.Another approach would be to add an animated scrollTo on
ScrollView
components, but that wouldn't help with non-constelation nodes.It also might be valuable to export the abstracted
tweenValue
function, but I don't think that necessarily belongs in adom
module.Also... since the easing isn't as predictable as a time-clamped version, it might be useful to allow a
finalCallback
or pass aisDone
boolean to thecallback
when the tweening is done. The first option is arguably cleaner but having two function arguments that do similar things might be odd.closes #90