Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Material buttons should be accessible #197

Closed
marcysutton opened this issue Aug 26, 2014 · 5 comments
Closed

Material buttons should be accessible #197

marcysutton opened this issue Aug 26, 2014 · 5 comments
Assignees
Labels
a11y This issue is related to accessibility type: enhancement
Milestone

Comments

@marcysutton
Copy link
Contributor

Material Buttons currently have an interior button or anchor element that is not accessible. Buttons must be focusable and have text content or ARIA equivalents. To improve the accessibility of material-button, we should alter the component structure. It's actually not too far off in its current state, but the text content needs to go inside of the button element so it will be read aloud on focus:

<material-button class="material-button-raised">
    <canvas class="material-ink-ripple " style="top:0px; left:0px"></canvas>
    <button class="material-button-inner"></button>
    <span class="ng-scope">Button</span>
</material-button>

A more accessible button might look like this:

<material-button class="material-button-raised">
     <button class="material-button-inner">
        <canvas class="material-ink-ripple " style="top:0px; left:0px" 
                aria-hidden="true"></canvas>
        <span class="ng-scope">Button</span>
    </button>
</material-button>

The associated CSS should apply hover and focus styles to the internal button element. By using the native element, the role is communicated to assistive technologies by default, and tabIndex is also natively supported.

@marcysutton
Copy link
Contributor Author

This also affects other components: material-dialog, material-sidenav, material-toast, and possibly other uses in the Angular Material project UI.

@ajoslin
Copy link
Contributor

ajoslin commented Aug 27, 2014

Can you check out the master version and verify material-button's accessibility?

@marcysutton
Copy link
Contributor Author

Sweet, they are now interactive from the keyboard and accessible to a screen reader! We just need to work on focus styles, by letting :hover and :focus cascade to the actual button or anchor elements instead of material-button. We could leave that for #142.

@marcysutton
Copy link
Contributor Author

@ThomasBurleson @ajoslin Should we close this and fix the remaining hover state in the other open issue?

@ajoslin
Copy link
Contributor

ajoslin commented Aug 28, 2014

Yes, good idea.

@ajoslin ajoslin closed this as completed Aug 28, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a11y This issue is related to accessibility type: enhancement
Projects
None yet
Development

No branches or pull requests

3 participants