-
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
[EuiTable EuiBasicTable] Fix nested content alignment when selection is enabled #7895
[EuiTable EuiBasicTable] Fix nested content alignment when selection is enabled #7895
Conversation
- moves conditional padding to the outer wrapper from the cell to align nested table content with the parent table column if a selection is present and prevent issues with overlapping content
- ensures correct positioning by appling styles only to direct children
- updates EuiTableRowCell stories to ensure expected controls behavior
@walterra Yes, that's expected and was already the existing behavior but ONLY when selection is enabled for the table. If enabled we offset the nested table by the selection checkbox width. |
Oh great, thanks for confirming! I didn't notice I picked a screenshot that old that didn't have the bulk actions yet 😅 . |
// Offset expanded & selectable rows by the checkbox width to line up content with the 2nd column | ||
// Set on the `<td>` because padding can't be applied to `<tr>` elements directly | ||
checkboxOffset: css` | ||
.euiTableRowCell:first-child { |
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'm probably being a little nit-picky here, but wouldn't changing this to & > .euiTableRowCell:first-child {
also have fixed the issue? I'm a little hesitant to apply new props to EuiTableRowCell
mostly because it's a public top-level API change 🤷 (which would mean breaking changes or deprecations if they ever change again in the future)
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.
Oh damn, yes you're absolutely right! I should have noticed that 🤦♀️
That is definitely a more straight forward solution. I'll update 👍
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.
Reverted the API changes here in favor of the suggested style solution.
💚 Build Succeeded
History
|
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.
Beautiful!! Thank you for the story updates as well Lene!! ❤️
Going to go ahead and merge this for this week's release |
`v95.3.0` ⏩ `v95.4.0` _[Questions? Please see our Kibana upgrade FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)_ --- ## [`v95.4.0`](https://github.com/elastic/eui/releases/v95.4.0) - Added `anomalyChart`, `anomalySwimLane`, `changePointDetection`, `fieldStatistics`, `logPatternAnalysis`, `logRateAnalysis` and `singleMetricViewer` glyph to `EuiIcon` ([#7873](elastic/eui#7873)) **Bug fixes** - Fixed overlapping content in `EuiBasicTable` for expanded and selectable table rows ([#7895](elastic/eui#7895)) - Fixed the alignment of `EuiBasicTable` mobile actions ([#7895](elastic/eui#7895)) **Accessibility** - Improved `EuiStat`'s screen reader accessibility ([#7864](elastic/eui#7864)) --- ## Additional Changes - reverts temporary fix for overlapping content in nested tables done in PR [#188374](#188374) --------- Co-authored-by: Elastic Machine <[email protected]>
Summary
closes #7888
Changes
Previously the implementation of applying the padding on each nested table row resulted in overlapping content issues. This PR proposes to apply the padding on the outer wrapper for the nested table content.
before
after
before
after
QA
EuiBasicTable
and verify it looks and works as expectedEuiTableRowCell
story and confirm controls are working as expectedGeneral checklist
Added documentation@default
if default values are missing) and playground togglesChecked Code Sandbox works for any docs examplesAdded or updated jest and cypress testsIf applicable, added the breaking change issue label (and filled out the breaking change checklist)If applicable, file an issue to update EUI's Figma library with any corresponding UI changes. (This is an internal repo, if you are external to Elastic, ask a maintainer to submit this request)