-
Notifications
You must be signed in to change notification settings - Fork 840
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
[EuiTable] Remove overflow/height animation causing Safari cross-browser issues #6826
Conversation
The overflow/height combo causes Safari to return an empty `innerText` on initial render, which is problematic for expandable content that uses our inner text or copy utils. Since the animation honestly is adding nothing functional, and is slightly laggy, I opted for an immediate height expansion and a very slight opacity/translate Y animation for a little extra pizazz.
Preview documentation changes for this PR: https://eui.elastic.co/pr_6826/ |
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.
+1 for the overall simplicity.
Minor suggestion on the animation settings.
As a heads up, going to go ahead and revert the docs QA change since you've had a chance to test this already. |
This reverts commit c2cf575.
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.
Rad. Thanks for the change!
Preview documentation changes for this PR: https://eui.elastic.co/pr_6826/ |
This is a backport EUI upgrade to Kibana v8.8.1 containing an `EuiCodeBlock` bugfix requested by the Observability team: #158644 (comment) ## [`77.1.5`](https://github.com/elastic/eui/tree/v77.1.5) **Bug fixes** - Fixed `EuiCodeBlock` potentially incorrectly ignoring lines ending with a question mark when using the Copy button. ([#6794](elastic/eui#6794)) - Fixed `EuiCodeBlock` to not include line numbers when copying content ([#6824](elastic/eui#6824)) - Fixed the expanded row animation on `EuiBasicTable` causing cross-browser Safari issues ([#6826](elastic/eui#6826)) Co-authored-by: Kibana Machine <[email protected]>
## Summary `[email protected]` ⏩ `[email protected]` ✨ Highlights: - fixes #158644 - Adds a new Timeline icon for use within `EuiMarkdownEditor` (cc @kqualters-elastic) - Expandable rows used within `EuiBasicTable` and `EuiInMemoryTable` now have a faster and snappier expand animation ___ ## [`81.3.0`](https://github.com/elastic/eui/tree/v81.3.0) - Added `timelineWithArrow` glyph to `EuiIcon` ([#6822](elastic/eui#6822)) **Bug fixes** - Fixed `EuiCodeBlock` potentially incorrectly ignoring lines ending with a question mark when using the Copy button. ([#6794](elastic/eui#6794)) - Fixed `EuiCodeBlock` to not include line numbers when copying content ([#6824](elastic/eui#6824)) - Fixed the expanded row animation on `EuiBasicTable` causing cross-browser Safari issues ([#6826](elastic/eui#6826))
Summary
closes #6770
Counter to our guesses/musings in the above linked thread, the issue with Safari was not the mutation observer (never fired) nor stale refs/rerenders. After adding timeouts of increasing lengths, I realized it was the animation itself that was causing Safari to return empty
innerText
.The
overflow: hidden
on the container, in combination with themax-height
, makes Safari calculate that the container's children are not visible. For not-visible children,innerText
becomes''
(you can test this right now in your browser by setting any DOM node tovisibility: hidden
and then pasting its.innerText
value in the console).I initially played around with a couple different options to try to keep the "expanding animation". I tried the
display: grid
hack instead ofmax-height
, I tried removingoverflow
and set anopacity
instead (but didn't really like how it looked) and I briefly contemplated calculating and settingheight
via JS instead of CSS 😅 Finally, I decided I preferred to subtract instead of adding.Since the animation honestly is adding no actual functionality, and the
max-height
CSS hack is laggy on almost every browser, I opted to not animate height whatsoever which allows the expansion to be immediate, and instead added a very light and far more performant opacity/translate Y animation. IMO, the outcome is a snappier and slightly more responsive feel.QA
Old animation for reference: https://eui.elastic.co/v81.2.0/#/tabular-content/tables#expanding-rows
EuiCodeBlock
in it (this may take several pages, it's random as the table is sorted)General checklist
- [ ] Added or updated jest and cypress tests- Not sure there's anything we can meaningfully test here since it's such a browser-specific issue + a CSS change- [ ] Updated the Figma library counterpart- Checking with the Figma working group to see if animations are a part of our Figma library