octopusthink / nautilus

Inclusive, open-source design system and React component library.
https://nautilus.octopusthink.com
MIT License
2 stars 0 forks source link

Button: Don't show an additional icon for an iconOnly button #270

Open sarahmonster opened 2 years ago

sarahmonster commented 2 years ago

If you use a semantic state (danger, caution, success, whatever) with a iconOnly button, you wind up with two icons:

CleanShot 2022-02-01 at 18 22 08

Obviously, this runs a little counter to the intention here, so let's tweak this behaviour so that only one icon appears at a time. We may want to consider making it effectively impossible to use two icons for the same button—I can think of very, very few use cases for this particular behaviour.

For reference, this error happens with iconOnly and trailingIcon, but if you use leadingIcon only the specified icon appears.