-
-
Notifications
You must be signed in to change notification settings - Fork 228
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
fix: eslint warning "anchor-is-valid" #4181
fix: eslint warning "anchor-is-valid" #4181
Conversation
…ted element in child 1, story 3
👷 Deploy request for oss-insights pending review.Visit the deploys page to approve it
|
✅ Deploy Preview for design-insights ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Compliance Checks Passed!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @CorinaMurg! 🚢
## [2.64.1-beta.1](v2.64.0...v2.64.1-beta.1) (2024-10-25) ### 🐛 Bug Fixes * eslint warning "anchor-is-valid" ([#4181](#4181)) ([5b67103](5b67103))
Description
This PR fixes the eslint-jsx-a11y warning "anchor-is-invalid" present in
components/atoms/ToggleGroup/toggle-group.stories.tsx
. The "anchor-is-invalid" rule checks that all anchors are navigable elements.The purpose of the
CustomItems
story inToggleGroup
is to demonstrate how to use HTML elements or nested elements as children ofToggleGroup
. The first child was initially an<a>
element nested inside adiv
, and the accessibility linter was complaining that thehref
value of#
was invalid. Adding a validhref
value would have taken care of the warning, however we would still be left with a serious accessibility issue not covered by the linter.The children of the
ToggleGroup
are tabs, so basically buttons. Having alink
nestedinside
a button creates accessibility issues for screen reader users, as well low-vision users and those relying on voice control. This PR replaces the<a>
element with a<span>
. Ideally, a future PR will look into restricting the children ofToggleGroup
to only non-interactive elements.Related Tickets & Documents
Fixes #4136
Mobile & Desktop Screenshots/Recordings
N/A
Steps to QA
N/A
Tier (staff will fill in)
[optional] What gif best describes this PR or how it makes you feel?
(Sorry, just flew in from the 20th century. What is a good resource for gifs?)