Skip to content
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

[EuiScreenReaderOnly] Safari + VO renders absolutely positioned outline #5168

Closed
cee-chen opened this issue Sep 10, 2021 · 1 comment
Closed

Comments

@cee-chen
Copy link
Contributor

This is a known browser issue that applies to only Safari+VO. It does not occur in Safari without VO enabled (e.g. while keyboard tabbing) and it does not occur in either Chrome, Firefox, or Edge.

Problem

Our EuiScreenReaderOnly CSS absolutely positions the visually hidden (but still detectable to screen readers) text in order for it to not affect rendering flow on other nearby elements.

Workaround

Prior to #5152, we positioned elements left: -10000px offscreen. We now position items at just left: 0 and set a margin of -1px to accomplish the same rendering. This means that if you can set position: relative CSS on any parent wrapper around your screen reader only text, and it will no longer render an outline in Safari away from its focused parent.

image

CodeSandbox demo

Here is a CodeSandbox demo you can use to test in Safari+VO.

Screen reader usage notes

We made the positioning change in #5152 to make it easier for EUI users to add a workaround for those that want even better Safari+VO support, but if for some reason it's difficult for you to do so, it's worth keeping in mind that desktop Safari+VO usage is ~5% as of 2021, and that the actual screen reader text still works perfectly, and this is a visual bug only on a tool aimed at non (or limited) visual users.

cee-chen pushed a commit that referenced this issue Sep 15, 2021
* Update .euiScreenReaderOnly to use clip

- this prevents issues with absolute positioning and scrolling containers, and works on all modern browsers supported by EUI

* [PR feedback] Add comment with more context

* Fix screenReaderOnly CSS to only apply to check/radio inputs with labels

* Clean up noLabel input CSS that was overriding previous screen reader CSS

* Add changelog entry

* [PR feedback] Docs & Comments & Updates styles for EuiScreenReaderOnly

cee-chen#2

* [Docs] Updated Accessiblity Utility pages with more nuances about EuiScreenReaderOnly

* Remove `euiScreenReaderOnly` mixin from checkbox and radio styles in favor of always having the input

* Commented Sass

* [EuiLink] Position relative if `target=_blank` for positioning screen reader text

* Remove button/position relative documentation/example in favor of #5168

@see cee-chen#2 (comment)

* Add 2nd changelog entry

Co-authored-by: Caroline Horn <[email protected]>

Co-authored-by: Caroline Horn <[email protected]>
@daveyholler daveyholler closed this as not planned Won't fix, can't repro, duplicate, stale Jan 30, 2023
@cee-chen
Copy link
Contributor Author

This isn't something we'll address on EUI's side of things as it's a browser issue, but we can use this issue as reference in case another consumer or Kibana user complains about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants