Skip to content
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

Role attribute on native semantic elements <a> #539

Closed
trevorsaint opened this issue Aug 3, 2017 · 2 comments
Closed

Role attribute on native semantic elements <a> #539

trevorsaint opened this issue Aug 3, 2017 · 2 comments

Comments

@trevorsaint
Copy link

Is the role attribute on an anchor tag correct usage of the role attribute?

Adding the role attribute to a span tag perhaps, but not an anchor tag.

Passing this through tenon.io comes back a fail.

How would you expect it to work?

I don't think it is required on anchor tags.

We could perhaps use a data attribute of button and target this with the javascript shim to make it act as a button rather than targetting the role attribute.

<a class="button button-start" href="/page-url" data-type="button">As an example</a>

There may be good reason for this that I am unaware of...

@36degrees
Copy link
Contributor

Thanks for raising this.

This was previously discussed at length in #272, so it's worth reading through that for the background.

I believe the consensus was that the button role is appropriate as long as users expectations (and the way it's announced to assistive tech) are met - i.e. you can activate it using space, which is covered by the shim that was introduced as a result of that discussion.

@NickColley
Copy link
Contributor

Going to close this out as per @36degrees referenced issue. Thanks for raising @trevorsaint 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants