Open
Description
Steps to reproduce
Link to live example: (required)
Demo in Stackblitz : https://stackblitz.com/edit/react-qkjzbj?file=Demo.tsx
Steps:
- Inspect
.MuiBadge-badge
elements in dev tools - Click "Set to 0" and observe
Current behavior
- For
Badge
withshowZero={false}
content of.MuiBadge-badge
element will not be updated (will still be 8, depite of element being not visible) - For
Badge
withshowZero={true}
content of.MuiBadge-badge
element will be updated
Expected behavior
I believe this is wrong and content should updated to current value, even if element is not visible
Context
I am using Badge component and while testing if it visually hidden and has zero value when value is changed from anything other than 0 tests are failing because element is hidden but old value is present in the DOM.
Your environment
npx @mui/envinfo
Don't forget to mention which browser you used.
Output from `npx @mui/envinfo` goes here.
Search keywords: MuiBadge