-
-
Notifications
You must be signed in to change notification settings - Fork 628
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
Rule to disallow non-native DOM element interactions #78
Comments
This is a followup from https://github.com/evcohen/eslint-plugin-jsx-a11y/issues/77#issuecomment-241918479 |
Is this something we would want to error on or just warn with suggestion to use a natively-interactable DOM element? I know you've felt in the past that warning isn't entirely useful, but there are ways to make elements like |
How someone wishes to configure it would be up to them - and a helpful message is great - but I certainly wouldn't want anything to be configured as less than an error. There are totally a myriad of workarounds to make elements like |
To be clear, I was talking about our recommended config 😛 |
aha, in that case it's up to you. It's certainly an opinionated rule, so a warning might make sense there. |
How do you handle onClick events on divs then? |
For example,
onClick
should only be valid on<a>
,<button>
,<input>
,<textarea>
,<select>
… i'm sure I'm forgetting some, but there should not be anonClick
on a<div>
, for example.The same should apply to keyboard events.
The text was updated successfully, but these errors were encountered: