Skip to content

Commit

Permalink
Fix #2997: Badge 0 as a value not properly rendered (#2998)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Jun 20, 2022
1 parent 46e5ae6 commit 2ccf3f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/lib/badge/Badge.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { classNames, ObjectUtils } from '../utils/Utils';
export const Badge = React.memo(React.forwardRef((props, ref) => {
const otherProps = ObjectUtils.findDiffKeys(props, Badge.defaultProps);
const className = classNames('p-badge p-component', {
'p-badge-no-gutter': props.value && String(props.value).length === 1,
'p-badge-dot': !props.value,
'p-badge-no-gutter': ObjectUtils.isNotEmpty(props.value) && String(props.value).length === 1,
'p-badge-dot': ObjectUtils.isEmpty(props.value),
'p-badge-lg': props.size === 'large',
'p-badge-xl': props.size === 'xlarge',
[`p-badge-${props.severity}`]: props.severity !== null
Expand Down

0 comments on commit 2ccf3f4

Please sign in to comment.