eslint-plugin-jsx-a11y: no-static-element-interactions - false positive

no-static-element-interactions correctly throws with the following code:

  <div styleName="container" onClick={this.props.onClick}>

But still fails once I add role="button"

  <div styleName="container" onClick={this.props.onClick} role="button">

According to https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-static-element-interactions.md , it should succeed once I add the role attribute.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 5
  • Comments: 16 (1 by maintainers)

Commits related to this issue

Most upvoted comments

Thank you for the report. I’ll look into it!

Note that this hasn’t been the case for awhile now; eslint-config-airbnb has supported v5 for awhile, and v16 of the config supports v6 of this plugin.

{ code: '<div styleName="container" onClick={this.props.onClick} role="button">' },

Turns out this is an invalid template for testing. it needs to be closed. @javaherian I need some more info from you to proceed. Are you sure that the rule being triggered after you add role="button" isn’t interactive-supports-focus?