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

[div onclick="doStuff()"] should trigger an error #38

Open
Dan503 opened this issue Jun 6, 2020 · 2 comments
Open

[div onclick="doStuff()"] should trigger an error #38

Dan503 opened this issue Jun 6, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@Dan503
Copy link

Dan503 commented Jun 6, 2020

Is your feature request related to a problem? Please describe.
Dev's will commonly use <div> elements for buttons when they should be using <button> elements instead.

Describe the solution you'd like
<div onclick="doStuff()"> should trigger an error different to the typical "Use Semantic HTML5 or specify a WAI-ARIA role [role=""]" warning.

It should say something like "Use a <button> element instead of a <div> element for interactive controls."

@mvdschee
Copy link
Owner

He @Dan503 I think that's a good addition to the check, will look in to it!

@mvdschee mvdschee added the enhancement New feature or request label Sep 30, 2020
@Dan503
Copy link
Author

Dan503 commented Sep 30, 2020

There are legitimate cases for adding div[onclick] so there should also be a way to ignore this rule.

(eg. Making a card clickable without wrapping the whole card in a link while making the heading inside the card an <a> element)

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

No branches or pull requests

2 participants