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

ProgressBar does not show value for 0% #973

Closed
fabervae opened this issue Jul 26, 2019 · 1 comment

Comments

@fabervae
Copy link

commented Jul 26, 2019

Bug report

(Solution at the bottom)

I'm submitting a ... (check one with "x")

[x] bug report
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://forum.primefaces.org/viewforum.php?f=57

Codesandbox Case (Bug Reports)
Forked to: https://codesandbox.io/s/primereact-test-lmhfv

Current behavior

When the value property is set to 0, it is hidden instead of being displayed as 0%. Examining the DOM, you will notice that the progress bar with value 0 does not have the
<div class="p-progressbar-label" />
child.

Expected behavior

The aforementioned <div /> element should be present with its content set to "0%".

Minimal reproduction of the problem with instructions

As shown in the codesandbox, the only step necessary to reproduce this problem is by setting value={0} in the <ProgressBar /> element.

Please tell us about your environment:

Windows 10 64bit, npm 6.4.1

  • React version: 16.8.6
  • PrimeReact version: 3.18
  • Browser: [all]
  • Language: [all]

Solution

I considered creating a PR as the fix, unless I missed something, is very simple. Just like how it was fixed in #4831 in PrimeNG, modifying the check on this.props.value to this.props.value !== null inside renderLabel() would do the trick. Link to the code.
I implemented it locally by modifying the corresponding line in the "ProgressBar.js" file, and it did the trick.
The impact should be minimal, but you're the experts on that. If it looks A-OK, I can create a PR for it.

@mertsincan mertsincan changed the title ProgressBar does not show value for 0% (fixed in PrimeNG, #4831) ProgressBar does not show value for 0% Aug 28, 2019

@mertsincan mertsincan self-assigned this Aug 28, 2019

@mertsincan mertsincan added the defect label Aug 28, 2019

@mertsincan mertsincan added this to the 3.1.9 milestone Aug 28, 2019

@mertsincan

This comment has been minimized.

Copy link
Member

commented Aug 28, 2019

Thanks a lot for the PR!

Best Regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.