-
-
Notifications
You must be signed in to change notification settings - Fork 78.8k
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
Accessibility: Bootstrap must not remove outline on focusable disabled buttons #40564
Comments
Related to #38903 , but the intention is not on accessibility there. |
a button with |
Tried to reproduce with default Bootstrap Dropdown menu and I could not reproduce the outline issue: I'll recheck the code where it actually fails. Found another a11y issue: https://getbootstrap.com/docs/5.0/components/dropdowns/#accessibility
Example https://codepen.io/rr-it/pen/zYQpmpL
Tab-key usage:twbs-dropdown-aria-disabled-tab_key.webmArrow-key usage:twbs-dropdown-aria-disabled-cursor_keys.webm |
the cursor behaviour is a nice-to-have addition, but if you are disabling a control with |
So the original issue is not Bootstrap related. It was provoked by some custom CSS rule: --typo3-list-item-disabled-border-color: transparent;
.dropdown-item.disabled, .dropdown-item:disabled {
outline: 1px solid var(--typo3-list-item-disabled-border-color);
}
Use-case:Dropdown menu wit a menu-entry to trigger action "set internal bookmark": When the bookmark is already set, a special info is shown that the bookmark is already set:
Trigger sequence using
|
Screen readers still read out buttons that are
for what it's worth, at least on Windows, in regular application menus, disabled menu items don't receive focus - so it's not unusual |
Orca (Screenreader for Gnome Desktop on Linux) has two modes
Orca + Firefox on Linux:
In 'browse mode' the cursor-keys are solely handled by orca - e.g. Bootstrap cursor-key Orca has some handy auto-mode-switching which is triggered on focusing the first item of a list:
But if you don't wait for all these announcements to finish, e.g. by pressing
I never waited - and thereby I did never reach the disabled items. |
A new test-case: first element disabledhttps://codepen.io/rr-it/pen/MWdrdrO Result on dropdown-open via
Result on combined dropdown-open with jumping into list by cursor-key
On all examples above where the focus goes to the second element, screenreader Orca still announces the number of elements (e.g. 3) with all elements included, but no current position. How do other screenreader software react in this case? Do they also focus the first non- |
there is no issue here. activating button via |
@patrickhlauke Thanks for your time for looking into this! What I learned:
|
@patrickhlauke You write:
The docs for 'Dropdowns' says:
Here the docs should be changed, shouldn't they? |
Prerequisites
Describe the issue
A disabled button that is still focusable by keyboard must show on focus that it has the current focus.
Otherwise a user does not see where the current focus is.
Here the outline gets removed:
bootstrap/scss/_reboot.scss
Lines 395 to 402 in d2d4581
There is a special HTML attribute to explicitly state the intend to make a button disabled and keep the button focusable at the same time:
aria-disabled="true"
See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-disabled
Reduced test cases
This button below is intentional focusable by the use of the attribute
aria-disabled="true"
:Therefore the button must have a visible outline on focus.
This button below is really disabled by the use of the attribute
disabled="disabled"
:If it becomes somehow focused, it might or might not have its outline visible.
What operating system(s) are you seeing the problem on?
Linux
What browser(s) are you seeing the problem on?
Firefox
What version of Bootstrap are you using?
v5.3.2
The text was updated successfully, but these errors were encountered: