Skip to content

Ignore a11y href warnings if role="button" set #1763

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

Closed
wants to merge 1 commit into from
Closed

Ignore a11y href warnings if role="button" set #1763

wants to merge 1 commit into from

Conversation

char
Copy link

@char char commented Oct 1, 2018

Using a span instead of an anchor when using on:click suppresses the warning but actually hinders accessibility.

I mentioned this in #1719, but I didn't receive a response.

Using a span instead of an anchor when using on:click suppresses
the warning but actually hinders accessibility.
@furstenberg
Copy link

Try using a button element instead.

@thgh
Copy link
Contributor

thgh commented Oct 7, 2018

I would also recommend to use <button>.
twbs/bootstrap#26831 (comment)

@Rich-Harris
Copy link
Member

Yeah, it really should be a button. If that's completely impossible for styling reasons or whatever, using a <span> instead of an <a> is still preferable AFAICT. What do you mean when you say it hinders accessibility?

@Rich-Harris
Copy link
Member

Also, please don't open duplicate issues. Sometimes it takes a while to respond to issues, and part of the reason is that there's a lot of them. Duplicating them compounds that problem. I'm closing this one.

@Rich-Harris Rich-Harris closed this Oct 7, 2018
@Rich-Harris
Copy link
Member

Ah, my bad — I didn't realise this was a PR rather than an issue. Nonetheless I think Svelte's behaviour is correct here.

@quantuminformation
Copy link
Contributor

A lot of times I do things like <a href="/settings" use:link>Settings</a> for example with svelte routing. Would be nice to have a setting to turn these warnings off. A lot of examples eg in tailwind use a for navigation stuff like this.

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

Successfully merging this pull request may close these issues.

5 participants