Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

progress bar percentage not recalculating on maxValue change #104

Open
likon416 opened this issue Apr 19, 2023 · 8 comments
Open

progress bar percentage not recalculating on maxValue change #104

likon416 opened this issue Apr 19, 2023 · 8 comments

Comments

@likon416
Copy link

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

@briansayles
Copy link

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

@natealmeida185
Copy link

I am having the same issue!! Even on 4.3.0

@amkgg
Copy link

amkgg commented Sep 25, 2023

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!

@CraigRonald555
Copy link

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
Copy link

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?

@Qurat-ul-ainn
Copy link

animatedCircleProps

not working

@CraigRonald555
Copy link

animatedCircleProps

not working

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

@FredMaia
Copy link

FredMaia commented Feb 24, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants