-
Notifications
You must be signed in to change notification settings - Fork 841
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] Add clip
property to fix scrolling bug
#5152
Conversation
Also heads up on this @qn895 - due to this being a breaking change release, this the will take a little longer to get into Kibana master, but should still arrive well before 7.16 FF. Please feel free to ignore the scrolling behavior on your plugin until then! |
Preview documentation changes for this PR: https://eui.elastic.co/pr_5152/ |
- this prevents issues with absolute positioning and scrolling containers, and works on all modern browsers supported by EUI
9ea18b6
to
e26b2e4
Compare
clip
property to fix scrolling clip
property to fix scrolling bug
Preview documentation changes for this PR: https://eui.elastic.co/pr_5152/ |
#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
Preview documentation changes for this PR: https://eui.elastic.co/pr_5152/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_5152/ |
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.
👍 LGTM. Though I wonder if we should also make not of the checkbox/radio input changes in the CL as well.
👍 I'm good with that - what do you think about |
I don't think that's a change though from what exists in master? |
I just tested https://elastic.github.io/eui/#/forms/form-controls#checkbox in Safari+VO and the outlines are going off-screen. Are they not for you? |
Right so there's no change from master to this PR, so there's nothing to note? Sorry, I guess I'm not understanding ... |
This PR fixes that per the commit you merged in: 5833109 https://elastic.github.io/eui/#/forms/form-controls#checkbox: https://eui.elastic.co/pr_5152/#/forms/form-controls#checkbox: |
@cchaos quick re-ping, can I get a sense of where you're at on the additional CL entry? It sounds like you don't think we should add one after all for checkbox/radio changes (or possibly the affected users is so minimal it's not worth an entry) - am I good to merge in this PR in that case? |
Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com>
Preview documentation changes for this PR: https://eui.elastic.co/pr_5152/ |
Heya @1Copenut! Would you mind reviewing this PR today or tomorrow since it's accessibility-related? Happy to hop on a call if needed to provide any extra context! |
@constancecchen I'll give this a look first thing in the morning. The afternoon got away fast. |
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.
👍 LGTM! I like what you did to bring the SR-only text into proximity with the inputs and links. I've noticed VoiceOver moving the black border around in the past, but never put it together this was because of the SR-only text's layout placement.
What do you think about adding a couple of guardrail rules to your CSS? Your screen shots are good representations of the visual, so they may not be needed. I'm defensive-minded and tend to plan for unexpected cases.
! global_styling/mixins/_helpers.scss
! These suggestions are preventative, probably not needed
@mixin euiScreenReaderOnly {
+ border: 0;
+ padding: 0;
}
Nice! I've no strong opinion about resetting border or padding personally - @cchaos, any thoughts there? |
I would first check to see if those properties even affect the display. Technically, if it's just a plain element our reset file should have already eliminated those and without adding the |
Thanks Caroline! Since I'm trying to get this PR in for the next release/today, I'm going to go ahead and merge in for now for expedience. But we can definitely add any extra resets needed in a future PR or if we have issues with EuiScreenReaderOnly again in the future (knock on wood)! |
[EuiScreenReaderOnly] summary
This PR contains #5130, which I'll re-copy the description & problem for here:
Problem
@qn895 reported an issue with their usage of
EuiInMemoryTable
within a scrolling container causing strange scrolling on the rest of their page/body. I was able to reproduce this behavior in our own docs page as well as in a CodeSandbox:Notice the page scrollbar jumping/increasing every time the table rows (and consequently table height) increases.
CSS-tricks put me on the right track of thinking it was a hidden absolutely positioned element that was causing the overflow issue. I also noticed when I had a table with plain text and no external link, I didn't have the same scroll issues. Well, I put 2 and 2 together, and it turns out it's the
.euiScreenReaderOnly
part of the table content that's causing the scroll/overflow shenanigans. In above screencap, the external link icon has SR text to indicate the link opens in a new window, and in the table @qn895 had issues with, the actions column icons have SR text to indicate their behavior.Solution
Adding to
clip
prevents the scrolling shenanigans mentioned above, and works on all modern browsers supported by EUI.This should be fairly safe change in terms of browser support - additionally, WebAIM, WordPress, 18f, and a11yproject all have snippets using
clip
.Some fun asides I stumbled upon during testing:
clip
is apparently going to be deprecated, which is why I includedclip-path
(per the above links)clip-path
didn't solve the above scroll issue by itself - onlyclip
didtop
andleft
positioning properties totally and the fix worked. However, on Chromium/webkit, justclip
alone didn't fix the scrolling issue: I neededleft: -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 :)[EuiCheckbox/EuiRadio] summary
The above
clip
CSS broke single EuiCheckbox/EuiRadio that had no labels (#5149). @cchaos came up with a solution in cee-chen#2, where we avoided using.euiScreenReaderOnly
on checkbox/radios inputs entirely and instead positioned hidden inputs over their faux inputs.Additionally, @cchaos added and cleaned up documentation, and fixed external EuiLinks outlines going off-screen in Safari+VO by setting
left: 0
and adding aposition: relative
wrapper.Checklist
- [ ] Check against all themes for compatibility in both light and dark modes- [ ] Checked in mobile- [ ] Props have proper autodocs and playground toggles- [ ] Added documentation- [ ] Checked Code Sandbox works for the any docs examples- [ ] Added or updated jest tests