[EuiDataGrid] Fix open cell popovers causing auto height rows to bug out #5618
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This was introduced in #5550 by our conversion to
EuiWrappingPopover
, which now dynamically inserts 2 extra DOM nodes around the cell popover anchor wrapper only when the popover is open:For some bizarre reason, this triggers the cell content's
offsetHeight
to briefly be larger than it should be, which immediately updates the row height cache even though the cell content height returns to normal almost immediately after.The easiest solution I could think of was to avoid setting the row height cache when the popover is opening, but I'm not sure if this will have unintentional side effects on consumer updates when the user has the popover open - those are likely very edge case, fingers crossed. I think the absolute best long-term solution might be to try and make
EuiWrappingPopover
/EuiPopover
optionally not add DOM wrappers, but this might be the best fix in the interim, unless you can think of something else.Really hoping we can get this merged in / backported along with the type fixes for the next Kibana upgrade! 🙏
Before
After
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- [ ] Checked for breaking changes and labeled appropriately- [ ] Checked for accessibility including keyboard-only and screenreader modes