JedWatson / react-select

The Select Component for React.js
https://react-select.com/
MIT License
27.56k stars 4.12k forks source link

Add option for custom aria-describedby #5871

Open Superman2971 opened 7 months ago

Superman2971 commented 7 months ago

Provides support for issues: #5562 and #1570

I've tested my fork on local repository to confirm this does indeed pass the provided aria-describedby to the react-select. Also tested and passed the yarn lint, yarn type-check, and yarn test per CONTRIBUTING.MD

Screenshot 2024-03-06 at 2 24 54 PM

Our team needs this implemented to meet a11y support for our use of react-select. We have some custom hint and error messaging that is related to the Select and needs to be accessibly connected through aria-describedby. I'm hoping we can contribute to the library and make this available in a minor update to the package. Please let me know what I can do to assist in getting this PR approved and ready to merge :) Cheers!

changeset-bot[bot] commented 7 months ago

⚠️ No Changeset found

Latest commit: 3344a08d28bd350afc10df8a3a4e03ee0c479d67

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

codesandbox-ci[bot] commented 7 months ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Superman2971 commented 7 months ago

I'm afraid I can't re-run the unit tests and I'm unsure why the tests aren't running in CircleCI.

Screenshot 2024-03-06 at 3 35 45 PM Screenshot 2024-03-06 at 3 33 25 PM

Locally all tests are running and pass (new test included)

Screenshot 2024-03-06 at 3 33 54 PM Screenshot 2024-03-06 at 3 34 08 PM

Hopefully this won't block the PR from moving forward. Let me know any progress I can make for this on my end and I'll jump on it.

plahteenlahti commented 5 months ago

Hey @Superman2971 I think your test is correct but you just need to run prettier:check and fix the error, which I think is that

'aria-describedby': this.props['aria-describedby'] || this.getElementId('placeholder'),

should be on two lines to so that it goes under the max line length of prettiest default setting

Superman2971 commented 5 months ago

you just need to run prettier:check and fix the error

Thank you @plahteenlahti! That was a good catch 👍 Now fixed 😄 ✅