-
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
fix(ScreenReaderOnly): Fix ScreenReaderOnly positioning to avoid scrolling issues #942
fix(ScreenReaderOnly): Fix ScreenReaderOnly positioning to avoid scrolling issues #942
Conversation
Size stats
|
Accessibility report ℹ️ You can run this locally by executing |
Deploy preview for mistica-web ready! ✅ Preview Built with commit ec771ca. |
@@ -14,5 +14,8 @@ export const screenReaderOnly = style([ | |||
height: 1, | |||
clip: 'rect(0, 0, 0, 0)', | |||
userSelect: 'none', | |||
// move the element out of the screen to avoid scrolling issues. See https://github.com/Telefonica/mistica-web/pull/942 |
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.
I'm curious if this doesn't affect other css tools like tailwind, reach-ui, etc:
https://tailwindcss.com/docs/screen-readers
https://github.com/reach/reach-ui/blob/main/packages/visually-hidden/src/reach-visually-hidden.tsx#L29-L42
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.
can be reproduced using tailwind: https://codepen.io/pladaria/pen/KKJyXjR
🎉 This PR is included in version 14.32.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
https://jira.tid.es/browse/WEB-2061 By default, the browser will read text content inside rows one by one (title, description, etc). With the changes in this PR, if an aria-label is provided to the informative row, the whole row will be read as a single text (the one provided in the aria-label prop) This PR also fixes https://jira.tid.es/browse/WEB-1885 which is a basically revert of #942. As part of this PR we allow passing custom styles (via `className` prop) to `ScreenReaderOnly` to workaround possible style issues found (like the one described originally in #942).
Before (note the extra scrollbar):
![image](https://private-user-images.githubusercontent.com/579417/282839438-9a5c1c52-a832-4d5f-8532-ca51a4feb27a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ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