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] Revert left positioning change #5215

Merged
merged 3 commits into from
Sep 27, 2021

Conversation

cee-chen
Copy link
Member

@cee-chen cee-chen commented Sep 24, 2021

Summary

We changed .euiScreenReaderOnly to left: 0 in #5152, specifically here.

Unfortunately, this change caused Kibana's FTR Selenium .getVisibleText() to include screen reader text when it previously did not:

These functional test failures can be viewed in our Kibana upgrade PR: elastic/kibana#112462

Why revert?

  1. I strongly think it will be significantly faster and less dev time/effort to backport this reversion to a new 38.0.1 release and update our Kibana upgrade to point at that release.
  2. It's extremely confusing from a Kibana dev POV to assert on/expect visually hidden text.
  3. I don't think the change to left: 0 is important. It only affects Safari on VO visually and it has no impact on actual screen reader functionality. I don't think that small visual nice-to-have is worth the developer time being spent right now on fixing Kibana tests/delaying the upgrade.

QA

node scripts/functional_tests --config x-pack/test/functional/config.js --grep='Elasticsearch overview mb'
  • Confirm this test passes (it's currently failing on Kibana CI)

Checklist

- [ ] Check against all themes for compatibility in both light and dark modes
- [ ] Checked in mobile
- [ ] Checked in Chrome, Safari, Edge, and Firefox
- [ ] Props have proper autodocs and playground toggles
- [ ] Added documentation
- [ ] Checked Code Sandbox works for any docs examples
- [ ] Added or updated jest tests
- [ ] Checked for breaking changes and labeled appropriately

  • Checked for accessibility including keyboard-only and screenreader modes
  • A changelog entry exists and is marked appropriately

- due to issues with Kibana Selenium functional tests
- It's unlikely those have Selenium text assertions on them in Kibana, so this is probably(?) safe
Comment on lines 4 to +10
&[target='_blank'] {
// Make the screen reader only text positioned relatively against the link itself
position: relative;

.euiScreenReaderOnly {
left: 0;
}
Copy link
Member Author

@cee-chen cee-chen Sep 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm 50/50 on keeping this in vs. just removing it entirely 🤷 I would be surprised if any Kibana functional tests were asserting on any external link text, so I think this is safe to keep in from that perspective - but I do also think it would be cleaner to require the external icon always for target="_blank" links and simply bake the (opens in a new tab or window) text into the icon aria-label itself (see cee-chen#2 (comment))

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm on the fence about this change. If there's a clear benefit in the exception to the wider SR-only rule, let's keep it. Otherwise, I think it could be removed.

I've also been thinking on the benefits and risks of adding the parenthetical to the aria-label attribute. Don't have a good argument either way, so I'll trend toward leaving it as is for now.

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5215/

Copy link
Contributor

@1Copenut 1Copenut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM! I left a couple of comments about screen reader behavior with the left rule being changed back. Holler at me with any questions!

Comment on lines 4 to +10
&[target='_blank'] {
// Make the screen reader only text positioned relatively against the link itself
position: relative;

.euiScreenReaderOnly {
left: 0;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm on the fence about this change. If there's a clear benefit in the exception to the wider SR-only rule, let's keep it. Otherwise, I think it could be removed.

I've also been thinking on the benefits and risks of adding the parenthetical to the aria-label attribute. Don't have a good argument either way, so I'll trend toward leaving it as is for now.

@@ -112,8 +112,8 @@
position: absolute;
// Keep it vertically inline
top: auto;
// Chrome requires a left value
left: 0;
// Chrome requires a left value, and Selenium (used by Kibana's FTR) requires an off-screen position for its .getVisibleText() to not register SR-only text
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The left: -10000px; rule will create a box that extends off the left of the screen in JAWS and VoiceOver, but does improve the situation with testing and is an existing behavior in EUI. I'd love to hear more about Chrome needing a left: 0; rule -- I hope I haven't been missing something important in the past.

Copy link
Member Author

@cee-chen cee-chen Sep 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, to clarify, Chrome required a left property to be set for the scrolling issue that #5152 fixed, not for screen-reader-only behavior alone. There's a footnote in the PR description about it:

On the subject of browser-specific shenanigans: in FF, I was able to remove the top and left positioning properties totally and the fix worked. However, on Chromium/webkit, just clip alone didn't fix the scrolling issue: I needed left: -10000px too 😖 The only other place I could find where someone else had this issue was this filed bug, but they seemed to come to the conclusion the issue was with FontAwesome, not Chromium (which I sorta disagree with, but c'est la vie). Maybe someday someone will google around and come across this issue, and the cycle of the internet will be complete :)

Copy link
Contributor

@cchaos cchaos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, making UI decisions based on testing mechanism/libraries is not a great path. But I'll approve this so the upgrade can move forwards since it will only affect a sliver of people.

@cee-chen
Copy link
Member Author

++, it's for sure not ideal, and I don't think anyone could have predicted Selenium would have such bizarre behavior here 💀 Going to go ahead and merge for upgrade expedience, maybe someone can take a look at this separately sometime in the future!

@cee-chen cee-chen merged commit 5942377 into elastic:master Sep 27, 2021
@cee-chen cee-chen deleted the eui-screen-reader-only-left branch September 27, 2021 18:36
@cee-chen cee-chen mentioned this pull request Sep 27, 2021
1 task
cee-chen added a commit to Heenawter/eui that referenced this pull request Nov 15, 2023
+ remove `left` CSS on SR text, IMO it's not doing anything / isn't necessary - see elastic#5215 (review)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants