-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set aria-disabled
instead of disabled on Button / SubmitButton
#325
Comments
I'm down with this. In generally, we disable buttons much more often then we have to- potentially we could fix this issue simply in the way we render these buttons. For instance, right now we often write: |
What do you think about making this change to usage? Any potential downsides you see? |
I definitely agree with your comment about the pristine disabling behavior. I like the idea of changing this usage, but I could see a downside in terms of enforcing it without updating the component. I'm in favor of removing the behavior to set disabled based on these props, instead forcing a developer to set disabled manually when they truly want to disable something. However, this would likely be considered a "breaking change". |
Yeah that's most definitely a breaking change. I feel like I could go either way on it. The behavior is arcane enough that if we removed it from any boilerplate (form component snippet) it probably wouldn't persist in any new apps moving forward. I guess the question is whether we want to retrofit our old apps- but that could also occur without a library change. If we go for it, we should make sure to get any important minor upgrades in before it as well. |
Can we mark this as a topic for discussion at the next priority meeting? |
@chawes13 sounds good! |
Disabling a button can be confusing for users as it generally doesn't provide information as to why it is disabled. Additionally, it removes the button from the tab order so users of assistive technologies may miss it altogether, depending on their style of navigation and the implementation of the AT.
Instead of setting disabled, we could set
aria-disabled="true"
, which would allow the button to be focused and would alert screen readers that it was disabled. Styling could target this attribute instead ofdisabled
. Additionally, we could force anoop
wheninvalid
is true OR we could force developers to handle the errors and tell users why the form failed.References:
The text was updated successfully, but these errors were encountered: