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
no-static-element-interactions
message suggests adding a role, but not changing the element.
#761
Comments
That makes sense to me. @jessebeach? |
I agree with @threehams that the best solution is a semantic element. So I suggest leading with that, rather than pushing the optimal recommendation to the end of the sentence after an or clause. Something like:
|
It is even not clear for me which are the static elements. |
uncommon-type
added a commit
to uncommon-type/eslint-plugin-jsx-a11y
that referenced
this issue
Mar 16, 2022
- Recommend using native HTML whenever possible - If using native counterpart is impossible, recommend adding to all interactive non-semantic elements an appropriate role along with support for mouse, keyboard and touch inputs. Fixes jsx-eslint#761
2 tasks
uncommon-type
added a commit
to uncommon-type/eslint-plugin-jsx-a11y
that referenced
this issue
Mar 16, 2022
- Recommend using native HTML whenever possible - If using native counterpart is impossible, recommend adding to all interactive non-semantic elements an appropriate role along with support for mouse, keyboard and touch inputs. Fixes jsx-eslint#761
uncommon-type
added a commit
to uncommon-type/eslint-plugin-jsx-a11y
that referenced
this issue
Mar 16, 2022
- Recommend using native HTML whenever possible - If using native counterpart is impossible, recommend adding to all interactive non-semantic elements an appropriate role along with support for mouse, keyboard and touch inputs. Fixes jsx-eslint#761
ljharb
pushed a commit
to uncommon-type/eslint-plugin-jsx-a11y
that referenced
this issue
Mar 16, 2022
- Recommend using native HTML whenever possible - If using native counterpart is impossible, recommend adding to all interactive non-semantic elements an appropriate role along with support for mouse, keyboard and touch inputs. Fixes jsx-eslint#761
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(sorry about the title, this is a very tough title to write)
The docs for the no-static-element-interactions rule cover two common cases of needing a static element.
The message on error:
This typically happens in pairs with
click-events-have-key-events
:However, both the docs and message are dancing around an issue: people use clickable divs because they don't know any better. Making an interactive
div
accessible requires a minimum of 3 extra properties, plus all the keyboard event handlers on top of click handlers (and all thekeyCode
listening necessary to match the role). The best fix for this rule is almost always to change the static element into an interactive element, but the message sends people down a more difficult and verbose path.Would you be willing to accept a change to have the message reflect this? I'm struggling with grammar consistency, but something like:
The text was updated successfully, but these errors were encountered: