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

Tweak react-a11y-anchors to ignore href="#" if onClick is present #383

Closed
cdeutsch opened this issue Jul 12, 2017 · 1 comment
Closed

Tweak react-a11y-anchors to ignore href="#" if onClick is present #383

cdeutsch opened this issue Jul 12, 2017 · 1 comment
Labels
Domain: Accessibility Rules around accessibility verification, commonly react-a11y-*. 💀 R.I.P. 💀 Status: In Discussion Please continue discussing the proposed change before sending a pull request. Type: Bug

Comments

@cdeutsch
Copy link

I don't think this part of react-a11y-anchors is a valid rule...

`Enforce an anchor element's href prop value is not just #
http://webaim.org/techniques/hypertext/#keyboard

...at least not if onClick is present

From the article...

<a href="#" onmouseover="dropdownmenu()">Products</a>

Both keyboard users and mouse users will experience nothing at all when attempting to activate the link.

If onmouseover was onclick then this statement is false because the click would do something.

Using <a href="#" onClick="foo()"> to trigger Javascript onClick is a very common pattern.

@JoshuaKGoldberg JoshuaKGoldberg added Status: In Discussion Please continue discussing the proposed change before sending a pull request. Domain: Accessibility Rules around accessibility verification, commonly react-a11y-*. Type: Bug labels Jul 4, 2018
@JoshuaKGoldberg
Copy link

💀 It's time! 💀

TSLint is deprecated and no longer accepting pull requests other than security fixes. See #876. ☠️
We recommend you instead use typescript-eslint to lint your TypeScript code with ESLint. ✅

👋 It was a pleasure open sourcing with you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Domain: Accessibility Rules around accessibility verification, commonly react-a11y-*. 💀 R.I.P. 💀 Status: In Discussion Please continue discussing the proposed change before sending a pull request. Type: Bug
Projects
None yet
Development

No branches or pull requests

2 participants