Closed svinkle closed 6 years ago
You can set your own role on the button (<paper-button role="link">
) if you know what you want. Otherwise, role=button
is a sensible default and WAI. <paper-button>
is a button and we think the space key for click is the right behavior.
Description
When navigating with a screen reader, the "Link" in the demo is announced as a "button." This is a result of the control featuring
role="button"
no matter the use case.Expected outcome
The "Link" in the demo to be announced as a "link."
Actual outcome
The "Link" in the demo is announced as a "button."
Live Demo
The demo page: https://www.webcomponents.org/element/PolymerElements/paper-button/demo/demo/index.html
Steps to reproduce
Tab
to the first demo control and listen to how it is described ("Link, button")Browsers Affected
All, including all assistive technology.
WCAG Info
Recommendation
link
prop. This would adjust therole
to equallink
. From here, screen readers would announce the appropriate semantic meaning of, "link".to
prop to represent the URL to link to. The value will be handled on the "back-end" to load the new page or jump to the desiredIDREF
section on the click event.to
prop could be output asdata-href
in order to keep things tidy.Space
key click event is not required. The expectation on ana
element would be forSpace
to scroll the page, as this is the defaultSpace
key behaviour.Example:
Output:
Additionally, the suggestion "to use
paper-button
as a link, wrap it in an anchor tag." doesn't work as expected with screen readers, so this could be removed.