segmented-arc-for-react-native icon indicating copy to clipboard operation
segmented-arc-for-react-native copied to clipboard

Animation might not run on iOS

Open YanVictor1027 opened this issue 1 year ago • 1 comments

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

YanVictor1027 avatar May 09 '24 23:05 YanVictor1027

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

jkhusanov avatar May 14 '24 00:05 jkhusanov

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

jkhusanov avatar May 28 '24 20:05 jkhusanov