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
As noted in #44427 (comment), the isPressed prop does not make sense in combination with certain variants or props, for example isDestructive or link.
The isPressed prop implies that the button represents an on/off toggle, which is distinct from usages where the button is purely for triggering actions.
Having nonsensical state combinations makes it harder to maintain the CSS, because it increases the number of cases that we have to deal with, even though they should never be used.
What is your proposed solution?
Create a new component (ButtonToggle?) that is a thin facade wrapper around Button. Remove all the props that don't make sense in this use case. Deprecate the isPressed prop and encourage devs to use ButtonToggle.
The text was updated successfully, but these errors were encountered:
I think this would be a good idea — I'm just unsure about how much clean-up we'll be able to do in Button, in case we can't remove the isPressed prop and the functionality that it brings
We definitely cannot remove it! Just a deprecation. I think the main benefit of this move is that we can relieve ourselves of the responsibility to fix/maintain the nonsensical state combos that people are likely not using at all.
What problem does this address?
As noted in #44427 (comment), the
isPressed
prop does not make sense in combination with certain variants or props, for exampleisDestructive
orlink
.The
isPressed
prop implies that the button represents an on/off toggle, which is distinct from usages where the button is purely for triggering actions.Having nonsensical state combinations makes it harder to maintain the CSS, because it increases the number of cases that we have to deal with, even though they should never be used.
What is your proposed solution?
Create a new component (
ButtonToggle
?) that is a thin facade wrapper around Button. Remove all the props that don't make sense in this use case. Deprecate theisPressed
prop and encourage devs to use ButtonToggle.The text was updated successfully, but these errors were encountered: