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
Use a default button for the main call to action on a page.
Avoid using multiple default buttons on a single page. Having more than one main call to action reduces their impact, and makes it harder for users to know what to do next.
We could consider checking for this. However the guidance is only "avoid" rather than a hard rule, so it might need to be overridden.
The text was updated successfully, but these errors were encountered:
Is having 2 green primary buttons on a page wrong?
Mostly, yes - I would include the multiple green error:
Avoid using multiple default buttons on a single page. Having more than one main call to action reduces their impact, and makes it harder for users to know what to do next.
The option to manually ignore with a flag sounds good, that means you know about the issue and made a conscious decision
Potentially we could output warning messages to the console log, unless you deliberately silence them. But they might still get ignored.
Another option would be to make the test fail unless you explicitly override it somehow. I did that for the disabled links, where you have to pass disabled: true. Could do something similar:
...or some kind of global setting somewhere. Feels a bit icky though, somehow?
Another alternative would be just to make the helper more opinionated and always fail if there are 2 primary buttons. Teams could still fall back to using click_button if they really wanted to ignore the warning...
The Design System guidance for Buttons says:
We could consider checking for this. However the guidance is only "avoid" rather than a hard rule, so it might need to be overridden.
The text was updated successfully, but these errors were encountered: