-
Notifications
You must be signed in to change notification settings - Fork 11
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
feat(Row): improve VoiceOver compatibility #1079
Conversation
Size stats
|
Accessibility report ℹ️ You can run this locally by executing |
Deploy preview for mistica-web ready! ✅ Preview Built with commit d67f944. |
src/list.tsx
Outdated
} = props; | ||
|
||
// iOS voiceover reads links with multiple lines as separate links. By setting aria-label and marking content as aria-hidden, we can make it read the whole row as one link. | ||
const iosVoiceOverLabelForLink = [title, subtitle, description, detail].filter(Boolean).join(' '); |
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.
caveat: headline is not read because it isn't included here. The problem is that headline
prop is a React.Node
, so I can't extract the text
@@ -45,7 +45,7 @@ test('Sheet', async () => { | |||
|
|||
await userEvent.click(closeButton); | |||
await waitForElementToBeRemoved(sheet); | |||
}, 20000); | |||
}, 30000); |
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.
Let's hope it doesn't fail again :(
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.
🤞
# [15.4.0](v15.3.0...v15.4.0) (2024-05-06) ### Bug Fixes * **AdvancedDataCard:** footer extra space ([#1102](#1102)) ([78e0e80](78e0e80)) * **Chip:** expand chips when inside a grid ([#1108](#1108)) ([32810ee](32810ee)) * **Dialog:** hide optional elements if not provided ([#1093](#1093)) ([1134b4a](1134b4a)) * **Hero:** add bottom padding inside slideshow only when it has bullets ([#1106](#1106)) ([9be0e88](9be0e88)) * **Hero:** use background instead of backgroundColor to support gradients ([#1091](#1091)) ([f4ba119](f4ba119)) * **PreviewTools:** update non working animation for floating case ([#1095](#1095)) ([dfccad5](dfccad5)) * **RowBlock:** set description text alignment to the right ([#1092](#1092)) ([9494d02](9494d02)) * **RowList:** update logic to render last divider ([#1110](#1110)) ([8db09d7](8db09d7)) * **Snackbar:** Desktop position ([#1096](#1096)) ([346f446](346f446)) * **Text:** make vivinho char replacement for screen readers work when Text have multiple children ([#1090](#1090)) ([e5c239c](e5c239c)) * **Video:** avoid duplicated state update in Video's state machine ([#1107](#1107)) ([8ae2ea0](8ae2ea0)) ### Features * **Accordion, Cards, Carousel, Feedback, Sheet, Slider:** replace Array with ReadonlyArray in props ([#1098](#1098)) ([22ee93a](22ee93a)) * **ButtonLink:** change chevron icon in Vivo-new skin ([#1103](#1103)) ([caedc61](caedc61)) * **FixedFooter:** Gradient background support ([#1073](#1073)) ([a7d4bd8](a7d4bd8)) * **Icons:** New routine and ethernet icons ([#1083](#1083)) ([edd7173](edd7173)) * **Image:** add srcSet ([#1109](#1109)) ([fa63884](fa63884)) * **o2-new:** dark mode improvements ([#1105](#1105)) ([d92e404](d92e404)) * **PosterCard:** improve accessibility ([#1087](#1087)) ([c56e177](c56e177)) * **Row:** improve VoiceOver compatibility ([#1079](#1079)) ([02f43d7](02f43d7)) * **Theme:** expose `colorValues` in theme ([#1104](#1104)) ([63c644e](63c644e))
🎉 This PR is included in version 15.4.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Fixes:
WEB-1724
WEB-1740
The main issue that was causing the bugs is that Safari reads links with multiple lines like different links. The workaround for this is:
<a>
element<a>
children<a>
should be computed with the content of the row, in this case we are concatenating[title, headline, subtitle, description, extra]
props to create the aria-label. The problem is that some of these props aren't simplestring
s but anyReactNode
, so we need to extract the inner text of the html elements on runtime to compute thearia-label
for the<a>
Other changes in the PR:
headline
to make screen readers read it aftertitle
Still pending:
details
part. When the row is a link/button it is read as part of the row as expected. But when we use some control (switch/checkbox/radio) the details part is not read because it's outside the div referenced byaria-labeledby
. Includingdetails
in the same div used forheadline
,title
,description
, etc would require a big refactor of this component layout