You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Setting the icon prop for the Callout component to {false} should remove the icon, but it does not.
To Reproduce
Steps to reproduce the behavior:
Add icon={false} as a prop to the Callout component (e.g. in a Storybook test, where it can easily be checked)
Expected behavior
This should remove the icon, like it does for the MUI component it is built upon. I also verified with Timmy that this is the expected behavior; see more in a Zeroheight comment here.
Recommended fix (per @tihuan ), documenting here for posterity:
Change the source code from
if (icon) return icon;
to:
if (icon !== undefined) return icon;
"And then the following will work:
icon={false} - it will not take up space in the component. Similar to display: none;
icon={<></>} - it will still take up space in the component, but just empty space. Similar to visibility: hidden;
icon={null} - this is a little counter intuitive, but it will fall back to using MUI's iconMapping"
(Thanks, @tihuan !!!)
The text was updated successfully, but these errors were encountered:
Describe the bug
Setting the
icon
prop for the Callout component to{false}
should remove the icon, but it does not.To Reproduce
Steps to reproduce the behavior:
icon={false}
as a prop to the Callout component (e.g. in a Storybook test, where it can easily be checked)Expected behavior
This should remove the icon, like it does for the MUI component it is built upon. I also verified with Timmy that this is the expected behavior; see more in a Zeroheight comment here.
Recommended fix (per @tihuan ), documenting here for posterity:
Change the source code from
if (icon) return icon;
to:
if (icon !== undefined) return icon;
"And then the following will work:
icon={false} - it will not take up space in the component. Similar to display: none;
icon={<></>} - it will still take up space in the component, but just empty space. Similar to visibility: hidden;
icon={null} - this is a little counter intuitive, but it will fall back to using MUI's iconMapping"
(Thanks, @tihuan !!!)
The text was updated successfully, but these errors were encountered: