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 feedback #20737
Comments
Very nice writeup, but I think its at least partially erronous. The |
Ha! Thnx for the write-up @BootstrapAccessilibty and initial comment @rafalp - in fact we've debated this link vs. button accessibility issue to (near) death in the https://ng-bootstrap.github.io (Bootstrap 4 integration for Angular 2). You can see the details here: ng-bootstrap/ng-bootstrap#142
It might depend on an application. In the context os SPAs many of the constructs that are links today (ex. pages in pagination, menu items id a dropdown, tab / accordion headers etc.) are not real links (that is, they don't change the page). Rather clicking on those invoke an action (go to a different page, execute a command from a menu etc.). In any case
As far as I understand both of those solutions are far from ideal (buttons can't be used in all places where Unfortunately I'm not an accessibility expert so not sure what the best / final solution is going to be but I'm happy that the discussion is happening here 👍 |
I believe that v4 should address some of these problems. |
As of today many (most?) of those issues are still in the v4 branch so I don't think it is v3 specific.
Do you have concrete examples? |
Interesting write-up, but most of it based on your opinion I'm afraid.
for the various "first rule of ARIA" - be careful not to naively interpret this as if it was indeed an absolute rule. Accessibility is about the end result, the user experience for users with disabilities, and there are always multiple ways to achieve the same thing. In many cases, compromises have to be made on which exact method to use (particularly in frameworks that are very high-level and allow users to build all sorts of sites/interfaces, as is the case with Bootstrap), but if the end result is the same (i.e. what a browser exposes via the accessibility API to AT), it comes down to personal preference HOW exactly the markup is structured, and whether it uses one particular patterns over another.
according to which authority, please? no, the construct used with
perfectly valid, again
clearly those are examples in the documentation itself, not examples of what we'd expect users to implement. fair enough, the example codes could be provided with some generic labels.
clearly no, as the dropdown contains links. or are you then suggesting adding
those are from examples for a site. they're dummy links to show how your proper navigation to different pages would look.
some as above, these are just dummy links...authors would then change those to links to pages on their site, or whatever.
modals are problematic, as true dialogs are not meant to have any content that is read with reading keys; the way bootstrap modals are used in the wild suggests we may actually want to drop the
this was a conscious decision, as for websites (rather than applications), non-AT keyboard users don't generally expect to use cursor keys. we're considering doing a half-way implementation |
Closing for now given the lack of todos here based on @patrickhlauke's comment. Feel free to open new, more specific issues if there is something here to follow up on though. |
Here are the semantics issues
Links with the
button
roleMozilla Developer Network(MDN)
Warning: Be careful when marking up links with the button role. Buttons are expected to be triggered using the Space key, while links are expected to be triggered using the Enter key. In other words, when links are used to behave like buttons, adding role="button" alone is not sufficient. It will also be necessary to add a key event handler that listens for the Space key in order to be consistent with native buttons.
Using
ARIA
attributes when there is a native html wayIn
W3C
document, you will find First rule of ARIA use:If you can use a native HTML element [HTML5] or attribute with the semantics and behaviour you require already built in, instead of re-purposing an element and adding an ARIA role, state or property to make it accessible, then do so.
For example:
aria-describedby
for the help text or error messageThe correct way should append error message after
label
without usingaria-describedby
tagaria-label
for Checkboxes and radios without labelThe correct way should be :
So much other places:
http://getbootstrap.com/components/#pagination-default
http://getbootstrap.com/components/#disabled-and-active-states
http://getbootstrap.com/components/#glyphicons-examples
http://getbootstrap.com/components/#btn-groups-toolbar
Input without
label
http://getbootstrap.com/css/#selects
http://getbootstrap.com/css/#textarea
http://getbootstrap.com/css/#inputs
Dropdown
should be replaced withselect
Based on First rule of ARIA use, it can use
select
(html native) to achieve same goalA tag with
href="#"
A
tag withhref="#"
should be replace withbutton
. Please look at When To Use The Button ElementFor example:
Tabs
Semantically
A
tag should be replaced with buttonShould be
Tabs with dropdowns
Based on First rule of ARIA use, it should use
button
directly without marking up links with therole="button"
.Should be
Linked items
Should be
Here are the issues in the javaScript:
modal
When using NVDA and ChromeVox, user cannot use up/down array key to read modal content, when it has
role="dialog"
androle="document"
Accordion
Based on First rule of ARIA use, it should use
button
directly without marking up links with therole="button"
.should be
tabs
Keyboard Interaction is not implemented. For example user cannot use left/right or up/down array keys to switch between tabs.
Please refer to https://www.w3.org/TR/wai-aria-practices-1.1/#tabpanel
The text was updated successfully, but these errors were encountered: