-
Notifications
You must be signed in to change notification settings - Fork 842
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
[EuiDataGrid] Fix open cell popovers causing auto height rows to bug out + misc cleanup #5622
[EuiDataGrid] Fix open cell popovers causing auto height rows to bug out + misc cleanup #5622
Conversation
The `flex` display on the parent `.euiDataGridRowCell` is unnecessary, and what's causing this bug
- it's being overridden by react-window's absolute positioning in any case
…the popover anchor wrapper - as far as I can tell, it's not doing anything
- the width properties aren't doing anything, so remove them - the height property is doing something but is superfluous with the inline height: 100%, so remove the inline style - add an overflow hidden to preserve overflowing content being correctly cropped by the cell padding when the popover is open (the EuiWrappingPopover adds extra div wrappers)
- can be conditional JSX instead of repeating EuiDataGridCellContent again
Preview documentation changes for this PR: https://eui.elastic.co/pr_5622/ |
Still going through examples, but found one issue with the focus ring being cut off on EuiButtons in a cell on https://eui.elastic.co/pr_5622/#/tabular-content/data-grid-focus BeforeAfter |
This cutoff was already occurring for me on latest main on Firefox. Is it not for you? edit: interesting, looks like it was occurring on FF but not on webkit. I wonder why. Investigating |
Second affected example, looks like the footer row no longer spans out of the viewport https://eui.elastic.co/pr_5622/#/tabular-content/data-grid-styling-and-control Beforefooter-before.movAfterfooter-after.mov |
+ was already in place in main since 40.0.0
- footer cells aren't virtualized and don't have absolute positioning inline
+ move footer-specific CSS that virtualized data grid cells don't need to the footer row file
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 can no longer reproduce the button & footer focus ring nor the footer cell widths issues 🎉
Changes LGTM
Preview documentation changes for this PR: https://eui.elastic.co/pr_5622/ |
Summary
This is an CSS-only alternative to #5618, and should (in theory) be a better approach with less side effects or edge cases on consuming applications. This also contains a lot more CSS cleanup.
Before
After
How does the fix work?
The main fix is 6b587ad which primarily just removes
display: flex
on.euiDataGridCell
. Thanks to Chandler for pointing me in the right direction on what was happening:Flexbox was the culprit for this, and was totally unnecessary on the
.EuiDataGridCell
- removing it did not affect any cell layout positioning as child wrappers were already taking care of that.Why is the removed CSS no longer needed?
The flex CSS and width CSS is likely no longer necessary for the following reasons
QA
Checklist
- [ ] Props have proper autodocs and playground toggles- [ ] Added documentation- [ ] Checked Code Sandbox works for any docs examples- [ ] Added or updated jest and cypress tests- [ ] Checked for breaking changes and labeled appropriately