Skip to content

Bug - TreeViewDataItem - customBadgeContent of number 0 is overwriten #11845

@adamviktora

Description

@adamviktora

Describe the problem

If we provide value of number 0 to a customBadgeContent property of TreeViewDataItem component, the value is ignored - instead the number of children of that TreeViewDataItem is displayed.

The issue is in TreeViewListItemBase:

<Badge {...badgeProps}>
    {customBadgeContent ? customBadgeContent : (children as React.ReactElement<any>).props.data.length}
</Badge>

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No fields configured for Bug.

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions