-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Badge: 0 as a value passed to a badge does not render properly #2997
Comments
I will look I have fixed similar issues before. |
I would be happy to submit a PR. My instinct is to coerce any value prop to a string. Does that sound like the right approach? edit: I could also just explicitly check for a 0 value and only coerce that. |
Cool if you want to submit a PR I will give you a hint it's pretty easy you just need to wrap the value prop in the function ObjectUtils.isNotEmpty it handles the 0 case |
Thanks. I might not get to it until next Sunday at this point. So, if you (or anyone else) want it fixed sooner, feel free. |
Describe the bug
When passing numeric values to a Badge, a 0 will not render properly. It renders the badge at the size as if no value was passed. However it still also shows the 0 value.
Reproducer
https://codesandbox.io/s/jolly-hugle-w9rwor?file=/src/App.js
PrimeReact version
8.1.1
React version
18.x
Language
TypeScript
Build / Runtime
Next.js
Browser(s)
No response
Steps to reproduce the behavior
Pass a numeric 0 value to the Badge. A string 0 value works as expected.
Expected behavior
It should render like other numeric values do.
The text was updated successfully, but these errors were encountered: