Skip to content

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

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

Open
adamviktora opened this issue May 27, 2025 · 0 comments · May be fixed by #11848
Open

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

adamviktora opened this issue May 27, 2025 · 0 comments · May be fixed by #11848
Assignees

Comments

@adamviktora
Copy link
Contributor

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: PR Review
Development

Successfully merging a pull request may close this issue.

1 participant