If you're building a form then you may want the submit button to be disabled until the form has been completed correctly. Using the disabled attribute on the submit button will however not allow the user to tab to it.
A better solution could to be disable click events on the submit button and make the button be announced as disabled with the aria-disabled="true" attribute. If you do that with Bootstrap though it doesn't use the disabled state button CSS. (Quick demo: https://stackblitz.com/edit/bootstrap-disabled-buttons )
I read about this on: https://a11y-101.com/development/aria-disabled
TLDR: A disabled button currently has CSS something like this:
.btn.disabled, .btn:disabled, fieldset:disabled .btn {
....
}
I suggest it should include aria-disabled="true" buttons so compiled CSS would be:
.btn.disabled, .btn:disabled, fieldset:disabled .btn, .btn.aria-disabled="true" {
....
}
I know there are more accessibility considerations regarding my form scenario example mentioned above, but I still think it probably makes sense for aria-disabled="true" buttons to use the same styles as disabled buttons.
If you're building a form then you may want the submit button to be
disableduntil the form has been completed correctly. Using thedisabledattribute on the submit button will however not allow the user to tab to it.A better solution could to be disable click events on the submit button and make the button be announced as disabled with the
aria-disabled="true"attribute. If you do that with Bootstrap though it doesn't use the disabled state button CSS. (Quick demo: https://stackblitz.com/edit/bootstrap-disabled-buttons )I read about this on: https://a11y-101.com/development/aria-disabled
TLDR: A disabled button currently has CSS something like this:
I suggest it should include
aria-disabled="true"buttons so compiled CSS would be:I know there are more accessibility considerations regarding my form scenario example mentioned above, but I still think it probably makes sense for
aria-disabled="true"buttons to use the same styles asdisabledbuttons.