debugger icon indicating copy to clipboard operation
debugger copied to clipboard

Fix jsx-a11y/no-static-element-interactions warnings raised by jsx-a11y linter.

Open yzen opened this issue 7 years ago • 10 comments

To get a list of accessibility warnings raised by jsx-a11y linter run: yarn lint:jsx-a11y.

From that list please note all instances that are flagged to have "jsx-a11y/no-static-element-interactions" problem. Each one needs to be addressed individually.

Once all of the instances are resolved make sure to change this setting in .eslintrc.jsx-a11y from:

"jsx-a11y/no-static-element-interactions": ["warn", {
  "handlers": ["onClick", "onMouseDown", "onMouseUp", "onKeyPress", "onKeyDown", "onKeyUp"]
}],

to

"jsx-a11y/no-static-element-interactions": ["error", {
  "handlers": ["onClick", "onMouseDown", "onMouseUp", "onKeyPress", "onKeyDown", "onKeyUp"]
}],

yzen avatar Dec 18 '18 15:12 yzen

So this error is essentially, not using buttons for actions and instead using divs/spans/etc.

What we want to do here as detailed is go through the warnings, assess the context of the markup, and devise a strategy to handle the cases as consistently as possible. For example, if we have something making an image or a span with an onClick handler, we'd change those to buttons with the text/image node inside of that.

Garbee avatar Dec 18 '18 19:12 Garbee

That's correct. Buttons is just one of the interactive elements, there's also anchor and other types of inputs (radios, checkboxes) etc. In worst case scenario, and highly discouraged, ARIA role can be used to set the semantics of the interactive element.

yzen avatar Dec 18 '18 20:12 yzen

Yup, we need to chose the appropriate interactive element to used depending on the task. But, we'd be better off taking advantage of them rather than using aria roles and scripting all the extra needs manually.

Garbee avatar Dec 18 '18 21:12 Garbee

/claim

ash-tamraz avatar Dec 23 '18 02:12 ash-tamraz

Thanks for claiming the issue! :wave:

!!! Please check your email and confirm the invitation

Here are some links for getting setup, contributing, and developing. We're always happy to answer questions in slack! If you become busy, feel free to /unclaim it.

:fox_face: Debugger team!

claim avatar Dec 23 '18 02:12 claim

@ash-tamraz @Garbee is this issue free ?

phoenixking25 avatar Jan 04 '19 14:01 phoenixking25

@phoenixking25 No, I'm still working on it and am close to having a patch ready.

ash-tamraz avatar Jan 04 '19 15:01 ash-tamraz

@yzen @ash-tamraz I'd like to help on this if it isn't being worked on anymore?

steffiau avatar Dec 31 '19 19:12 steffiau

/claim

RidamGarg avatar Jan 22 '21 21:01 RidamGarg

Firefox Developer Tools (including Debugger tool) development is entirely happening in Bugzilla and new issues should be reported here: https://bugzilla.mozilla.org/enter_bug.cgi?product=DevTools&component=Debugger

Also, supporting JSX in the code base is not on our long term roadmap, so this might be invalid report.

Honza

janodvarko avatar Feb 25 '21 13:02 janodvarko