[EuiDataGrid] Fix buggy header cell display for sorted columns with no actions #6014
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
Before
After
Repro steps:
This bug only occurs on sorted header cells with actions disabled (i.e. no popover wrapper).
Cause
This bug appears to have been caused by the Emotion conversion of EuiIcon. Because Emotion CSS comes before our remaining Sass CSS, the width of the icon is being overridden by the
> * { width: 100%; }CSS. This will in theory(?) fix itself once we're fully on Emotion, but since that's a whiles away, this fix solves the issue in the interim by removing the> *blanket selector and only applying our.eui-fullWidthCSS utilities to specific divs that we need it.As far as I can tell the removal of
max-width: 100%;has no impact -.euiPopoveralready has max-width 100% and.euiDataGridHeaderCell__contentalso has a max-width of 100% due to its inheritance of our text truncation CSS.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- [ ] Checked for accessibility including keyboard-only and screenreader modes- [ ] Updated the Figma library counterpart