Skip to content

Commit

Permalink
Fix strut CSS for expander cells as well
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen committed Apr 2, 2024
1 parent 4a6a8e8 commit 22b40da
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/components/table/table_row_cell.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,19 @@ export const euiTableRowCellStyles = (euiThemeContext: UseEuiTheme) => {

const { mobileSizes } = euiTableVariables(euiThemeContext);

// Unsets the extra strut caused by inline-block display of buttons/icons/tooltips.
// Without this, the row height jumps whenever actions are disabled.
const hasIcons = `line-height: 1;`;

return {
euiTableRowCell: css`
color: ${euiTheme.colors.text};
`,

isExpander: css`
${hasIcons}
`,
hasActions: css`
/* Unsets the extra strut caused by inline-block display of buttons/icons/tooltips.
Without this, the row height jumps whenever actions are disabled. */
line-height: 1;
${hasIcons}
/* TODO: Move this to EuiTableCellContent, once we're further along in the Emotion conversion */
.euiTableCellContent {
Expand Down
1 change: 1 addition & 0 deletions src/components/table/table_row_cell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ export const EuiTableRowCell: FunctionComponent<Props> = ({
const styles = useEuiMemoizedStyles(euiTableRowCellStyles);
const cssStyles = [
styles.euiTableRowCell,
isExpander && styles.isExpander,
hasActions && styles.hasActions,
styles[valign],
...(isResponsive
Expand Down

0 comments on commit 22b40da

Please sign in to comment.