barvian / number-flow

A React component to transition, format, and localize numbers.
https://number-flow.barvian.me
MIT License
2.73k stars 54 forks source link

prevent horizontal animation when attaching to a slider #11

Closed davefallis closed 2 days ago

davefallis commented 1 month ago

I am trying to use this library in a way that the MotionNumber component moves horizontally as value changes, tied to a slider component. What I am observing is that the MotionNumber component itself is animating horizontally but I don't want the animation. I just want it to immediately move to the new location without the horizontal animation. Is there a way to stop the animation? I apologize if this is a general framer question. I am still learning the library.

barvian commented 1 month ago

Hi, thanks for filing. I agree this isn't ideal; I think normally you'd use layoutRoot to address this but in my tests that didn't seem to work with MotionNumber. I'm investigating potential solutions but I wouldn't expect anything soon unfortunately 🫤

barvian commented 2 days ago

I just launched a rewrite of this library that now includes a slider example supported by a new isolate prop: https://number-flow.barvian.me/examples/#slider 🙂. Please let me know if you're still experiencing issues