react-native-circular-progress-indicator icon indicating copy to clipboard operation
react-native-circular-progress-indicator copied to clipboard

progress bar percentage not recalculating on maxValue change

Open likon416 opened this issue 2 years ago • 8 comments

if we will dynamically change maxValue, for example using this value as a state, the progress bar percentage is not recalculated or recalculated wrongly.

likon416 avatar Apr 19 '23 06:04 likon416

Experienced the same thing. It works correctly in version 4.3.0.

briansayles avatar May 16 '23 13:05 briansayles

I am having the same issue!! Even on 4.3.0

natealmeida185 avatar Jul 02 '23 21:07 natealmeida185

Fixed: Set the maxValue to 1 and calculate the current value as percentage. It works perfectly and means you don't need to change the maxValue at all!

amkgg avatar Sep 25 '23 02:09 amkgg

I passed the maxValue as a dependency so that the animatedCircleProps are reconfigured whenever the maxValue changes i.e. when using a state value. This has fixed the issue on my local version.

CraigRonald555 avatar Nov 20 '23 17:11 CraigRonald555

Fixed: Set the maxValue to 1 and calculate the current value as percentage. It works perfectly and means you don't need to change the maxValue at all!

This may work for some scenarios but what about wanting to show the actual value? I’m guessing you could only display it, at best, as a percentage?

CraigRonald555 avatar Nov 21 '23 16:11 CraigRonald555

animatedCircleProps

not working

Qurat-ul-ainn avatar Nov 30 '23 10:11 Qurat-ul-ainn

animatedCircleProps

not working

Can you provide more details on what's going wrong? And your code implementation?

CraigRonald555 avatar Dec 01 '23 15:12 CraigRonald555

I added the key property and it worked. Here's a example:

value={isRestOn ? restMin * 60 - (minutes * 60 + seconds) : focusMin * 60 - (minutes * 60 + seconds)} maxValue={isRestOn ? restMin * 60 : focusMin * 60} key={isRestOn ? restMin * 60 : focusMin * 60}

with the key property, if restMin or focusMin change, the component will update

FredMaia avatar Feb 24 '24 17:02 FredMaia