Skip to content
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

jsx-a11y/no-onchange is deprecated #31895

Closed
stephenlprice opened this issue Jun 14, 2021 · 0 comments · Fixed by #31896
Closed

jsx-a11y/no-onchange is deprecated #31895

stephenlprice opened this issue Jun 14, 2021 · 0 comments · Fixed by #31896
Labels
topic: core Relates to Gatsby's core (e.g. page loading, reporter, state machine) type: bug An issue or pull request relating to a bug in Gatsby

Comments

@stephenlprice
Copy link

Description

I haven't seen this mentioned in other issues or discussions but the warning for this rule jsx-a11y/no-onchange should be deprecated as indicated by the docs for eslint-plugin-jsx-a11y.

Steps to reproduce

The following would trigger the warning:

<select value={subject} onChange={handleChange}>
  <option>Apples</option>
  <option>Oranges</option>
  <option>Peaches</option>
  <option>Bananas</option>
</select>

The following passes but setting state does not seem to work with onBlur, at least it seems to give problems to others as well. Maybe the handleBlur function needs to differ from the handleChange function in some way but I am not sure how.

<select value={subject} onBlur={handleBlur}>
  <option>Apples</option>
  <option>Oranges</option>
  <option>Peaches</option>
  <option>Bananas</option>
</select>
<select value={subject} onChange={handleChange} onBlur={handleBlur}>
  <option>Apples</option>
  <option>Oranges</option>
  <option>Peaches</option>
  <option>Bananas</option>
</select>

Expected result

The rule is deprecated as indicated by the docs.

Actual result

The first select tag triggered a warning. I could use // eslint-disable-next-line but I rather avoid it when possible.

Environment

[email protected] uses [email protected]

System:
OS: macOS 11.4
CPU: (8) arm64 Apple M1
Shell: 5.8 - /bin/zsh
Binaries:
Node: 15.9.0 - ~/.nvm/versions/node/v15.9.0/bin/node
npm: 7.5.3 - ~/.nvm/versions/node/v15.9.0/bin/npm
Languages:
Python: 2.7.16 - /usr/bin/python
Browsers:
Safari: 14.1.1
npmPackages:
gatsby: ^3.2.1 => 3.2.1
gatsby-plugin-mdx: ^2.3.0 => 2.3.0
gatsby-plugin-page-creator: ^3.3.0 => 3.3.0
gatsby-plugin-react-helmet: ^4.3.0 => 4.3.0
gatsby-plugin-sass: ^4.2.0 => 4.2.0
gatsby-plugin-sharp: ^3.4.0 => 3.4.0
gatsby-plugin-svgr: ^3.0.0-beta.0 => 3.0.0-beta.0
gatsby-remark-images: ^5.1.0 => 5.1.0
gatsby-remark-prismjs: ^5.0.0 => 5.0.0
gatsby-source-filesystem: ^3.2.0 => 3.2.0
npmGlobalPackages:
gatsby-cli: 3.4.1

@stephenlprice stephenlprice added the type: bug An issue or pull request relating to a bug in Gatsby label Jun 14, 2021
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jun 14, 2021
@LekoArts LekoArts added topic: core Relates to Gatsby's core (e.g. page loading, reporter, state machine) and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Jun 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: core Relates to Gatsby's core (e.g. page loading, reporter, state machine) type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants