-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
fix(ui): make LinkWithArrow behave like accessible button for modal open #8051
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(ui): make LinkWithArrow behave like accessible button for modal open #8051
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Pull Request Overview
This PR improves accessibility of the details button in the download releases table by making the LinkWithArrow component behave like a proper accessible button for modal opening. It addresses accessibility concerns by adding appropriate ARIA attributes and keyboard navigation support.
Key changes:
- Added proper button semantics with
role="button"
andtabIndex={0}
- Implemented keyboard support for Enter and Space key activation
- Enhanced screen reader support with
aria-label
apps/site/components/Downloads/DownloadReleasesTable/DetailsButton.tsx
Outdated
Show resolved
Hide resolved
There should be a way to do this without adding the additional listener, right? According to https://developer.mozilla.org/en-US/docs/Web/API/Element/click_event, the "click" event is emitted on key press. |
Thank you for the suggestion, @avivkeller! 🙌
You're absolutely right — a manual listener isn’t needed if the element were a native Since To solve this while preserving the current structure, I added a Alternatively, I'm also exploring replacing the underlying element with a native Really appreciate your input — Please, Let me know 🙏 |
I'd rather convert it to an anchor or button, instead of adding redundant listeners |
+1 this should be an actual semantic button |
Hi @avivkeller @MattIPv4 👋 I've updated the implementation to use a This change improves accessibility and removes the redundant event listener. Let me know if anything else needs adjustment — happy to iterate! |
What if we, instead, change the LinkWithArrow component itself to be an |
Thanks for the suggestion!, @avivkeller 🙌
Changing
That’s why it’s more robust to use the appropriate semantic element ( |
Okay, so why don't we have it be a |
Hi @avivkeller 👋 I've updated the
Let me know if any further refinements are needed — happy to iterate! 🙌 |
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.
Almost there!
Hi @avivkeller ,
Yes, this can be done like this
but for that we have to refractor some files like
|
That's not what I meant, I meant the type definition itself. If it's not possible, forget it |
Hi @avivkeller 👋, Thanks for the clarification! I misunderstood your suggested approach.
Since you meant it’s fine to skip if not possible— I’ve kept the simpler & skip it. All other previous changes are applied as ✅ suggested above. Let me know if anything else is needed! |
@Mohit5Upadhyay May I push a commit to resolve some last minute things, then we are good to go? |
conflicts :P |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8051 +/- ##
=======================================
Coverage 75.88% 75.88%
=======================================
Files 112 112
Lines 9433 9433
Branches 303 303
=======================================
Hits 7158 7158
Misses 2274 2274
Partials 1 1 ☔ View full report in Codecov by Sentry. |
Lighthouse Results
|
@avivkeller / @Mohit5Upadhyay there's a conflict, can any of you resolve it? |
a4c05c8
to
f185c88
Compare
Apologies, I think I may have broken something 😅. |
No worries! I can resolve the conflicts later today |
Thanks @avivkeller for taking care of this 🙏. I apologize — I tried resolving the conflicts earlier but ended up breaking something and it got a bit messed up. |
Ack! I got swamped, ping me again if you need help, I'll be available. |
f185c88
to
d6954ef
Compare
d6954ef
to
d7e7681
Compare
Co-Authored-By: Mohit5Upadhyay <[email protected]>
d7e7681
to
37dd0bc
Compare
Description
This PR solve the issue: #8048 by improving accessibility using
LinkWithArrow
as a button to trigger the modal with correctrole
,tabIndex
,aria-label
, and keyboard support.Validation
details-btn.mp4
Related Issues
Closes #8048
Check List
pnpm format
to ensure the code follows the style guide.pnpm test
to check if all tests are passing.pnpm build
to check if the website builds without errors.