-
Notifications
You must be signed in to change notification settings - Fork 370
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: [M3-7155] - Link Accessibility & Markup on Billing Detail page #9697
Conversation
{text} | ||
</Button> | ||
</> | ||
</CSVLink> |
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.
Here we use the CSV link as the accessible element rather than the button. (also, downloads are semantically links with href)
Rendering the as a span is a decent way to keep the styling identical while being semantically correct (buttons are not permitted within <a>
tags)
Content model: Transparent, but there must be no interactive content descendant.
The a element may be wrapped around entire paragraphs, lists, tables, and so forth, even entire sections, so long as there is no interactive content within (e.g. buttons or other links).
<Grid sm={4} sx={sxGrid} xs={12}> | ||
<Link to={`/account/billing`} data-qa-back-to-billing> | ||
<Link | ||
accessibleAriaLabel="Back to Billing" |
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.
This is the missing tag/accessibility support causing the console error:
https://github.com/linode/manager/blob/develop/packages/manager/src/components/Link.tsx#L83-L88
It works! 🎉
@@ -14,7 +14,7 @@ interface DownloadCSVProps { | |||
data: unknown[]; | |||
filename: string; | |||
headers: { key: string; label: string }[]; | |||
onClick: () => void; | |||
onClick?: () => void; |
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.
Looks like we still may need the onClick support on the MaintenanceTable
component
Thanks for tackling this, @abailly-akamai ! Interestingly, even with the I'll attach screen recordings to M3-7155 momentarily which can probably do a better job explaining what I'm seeing |
@jdamore-linode thanks for that! the |
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.
@abailly-akamai Thanks, looks great! Confirmed that the label is announced by VoiceOver and that the focus/activation behavior when using keyboard navigation is fixed. Also pushed a quick test fix for the Download CSV and Download PDF buttons
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.
🎉 Tested:
- no console warnings for link accessibility
- Download CSV link works as expected
- voiceover sounded good for the back to billing link / included 'Back to billing' in the voiceover and other links/buttons
- UI looks good (matches the develop branch -- prod doesn't have the Region column in the invoice table yet, so I didn't check against there)
Description 📝
Small PR to improve accessibility and markup on the Billing Detail page since those were bothering me and throwing warnings in the console.
Major Changes 🔄
Preview 📷
This PR should contain no visual regression and should be tested against any.
How to test 🧪
Local Setup:
Pull and run code locally
Steps: