Chakra-ui: [CircularProgress] [Progress] Value 0 for value prop results in unexpected behaviour in V1

Created on 11 Jul 2020  路  1Comment  路  Source: chakra-ui/chakra-ui

Describe the bug
Specifying value={0} for <CircularProgress /> component results in the percentage to be undefined. This results in showing an indeterminate state instead of showing 0 progress.

When looking into the issue I checked what happens for the <Progress /> component when value={0} and it renders 100% progress instead of 0. This seems to be an issue as well.

Expected Behavior
<CircularProgress /> with value={0} shows the track without any "progress".
<Progress /> with value={0} shows the track without any "progress".

Link to minimal reproduction
https://codesandbox.io/s/chakra-ui-progress-issues-t05ed

Suggested solution(s)
Inside getProgressProps function make sure that value can be 0 to return 0% instead of undefined.

Desktop (please complete the following information):

  • OS: macOS
  • Browser Chrome
  • Version: 83

Additional context
Let me know what you think should happen and if the indeterminate state is intentional when value equals 0. I'm glad to help by creating a PR!

Bug 馃悰

Most helpful comment

Thanks for reporting this @tristandubbeld.

I've just fixed this and we'll release an update shortly.

>All comments

Thanks for reporting this @tristandubbeld.

I've just fixed this and we'll release an update shortly.

Was this page helpful?
0 / 5 - 0 ratings