Comments (7)
Btw I think also inputs work as well - essentially form elements and links should have that behavior default. It's the elements that you're adding non default behavior to where you have to also add in keyboard listeners
from eslint-plugin-jsx-a11y.
Oh right, of course.
from eslint-plugin-jsx-a11y.
For purposes of semantic markup, why would we want to encourage adding onClick
to a non-natively-clickable thing anyways?
from eslint-plugin-jsx-a11y.
Yeah, it should likely suggest using a button or link first, or alternatively adding the keyboard stuff.
from eslint-plugin-jsx-a11y.
Do we have another rule that can actively prohibit adding interaction behavior to non-natively-interactable DOM elements?
from eslint-plugin-jsx-a11y.
Do we have another rule that can actively prohibit adding interaction behavior to non-natively-interactable DOM elements?
No but we have onclick-has-role, which requires adding the role
prop to non-natively-interactable DOM elements with click handlers.
just to clarify, this seems like we are taking the logic for determining non-interactive DOM elements from onclick-has-role
and enforcing that those elements with onClick
handlers have accompanying onKeyDown
, onKeyUp
, or onKeyPress
props.
rule: click-events-have-key-events
(similar to mouse-events-have-key-events)
from eslint-plugin-jsx-a11y.
I filed #78 for https://github.com/evcohen/eslint-plugin-jsx-a11y/issues/77#issuecomment-241918479
from eslint-plugin-jsx-a11y.
Related Issues (20)
- Changelog links broken due to different repo HOT 1
- jsx-a11y/label-has-associated-control gives error when for is put HOT 3
- label-has-associated-control regression
- How to configure `eslint-plugin-jsx-a11y` in `eslint.config.js` HOT 5
- [label-has-associated-control] regression - rule errors when a label does not directly have text, even if it has htmlFor HOT 8
- jsx-a11y/control-has-associated-label triggers on TD element HOT 1
- Coordinate NodeJS version support with axe-core HOT 9
- [img-redundant-alt] `words` option does not work with double-byte character words.
- `alt-text`: missing warning for empty `alt` for `<input type="image" alt="" />`
- [label-has-associated-control] Glob format not supporting labelComponents HOT 1
- Snyk: MPL 2.0 license vulnerability in axe-core HOT 2
- anchor-has-content and aria-labelledby
- Lint error on valid way for associating a `label` to an `input` control HOT 1
- `jsx-a11y/label-has-associated-control` behavior is apparently misdocumented HOT 10
- Add support for ESLint 9 HOT 3
- heading-has-content false positive for object spread HOT 1
- [control-has-associated-label]: Does not allow for custom components that would result in accessible labels HOT 1
- `jsx-a11y/media-has-caption` Eslint Warning for Missing Captions in Media Elements HOT 1
- bug: type declaration for eslint flat config HOT 3
- Rule Idea: Enforce boolean literals for "booleanish" HTML attributes such as aria-hidden HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eslint-plugin-jsx-a11y.