You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[x] bug report
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://forum.primefaces.org/viewforum.php?f=57
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.
The text was updated successfully, but these errors were encountered:
Bug report
(Solution at the bottom)
I'm submitting a ... (check one with "x")
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
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
tothis.props.value !== null
insiderenderLabel()
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.
The text was updated successfully, but these errors were encountered: