shipt / segmented-arc-for-react-native

Segmented arc component for React Native
MIT License
93 stars 10 forks source link

Animation might not run on iOS #89

Closed YanVictor1027 closed 4 months ago

YanVictor1027 commented 5 months ago

Please Update the following code in SegmentedArc.js Animated.timing(arcAnimatedValue, { toValue: lastFilledSegment.filled, duration: animationDuration, delay: animationDelay, useNativeDriver: false, easing: Easing.out(Easing.ease) }).start(); const listenerId = arcAnimatedValue.addListener(e => { if (e.value === lastFilledSegment.filled) animationRunning.current = false; });

To

new Animated.timing(arcAnimatedValue, { toValue: lastFilledSegment.filled, duration: animationDuration, delay: animationDelay, useNativeDriver: false, easing: Easing.out(Easing.ease) }).start(({finished}) => {if (finished) animationRunning.current = false});

As comparing two value might fail due to precision issue. https://reactnative.dev/docs/animated#start

jkhusanov commented 5 months ago

Hi @YanVictor1027, have you experienced that issue? So far we have not seen it happening on iOS.

jkhusanov commented 4 months ago

Closing this issue due to inactivity, please create a new one if you experience this problem again. Thanks!