Skip to content

Commit

Permalink
[EuiTableRowCell] Fix where className is applied to ⚠️
Browse files Browse the repository at this point in the history
- I have no idea why it would apply to the content div instead of to the actual cell element :|||

- !! this is a breaking DOM change and will need careful Kibana migration
  • Loading branch information
cee-chen committed Mar 28, 2024
1 parent 70fb721 commit 1065b0b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ exports[`renders EuiTableRowCell 1`] = `
<tr>
<td
aria-label="aria-label"
class="euiTableRowCell euiTableRowCell--middle emotion-euiTableRowCell-desktop"
class="euiTableRowCell testClass1 testClass2 euiTableRowCell--middle emotion-euiTableRowCell-desktop-euiTestCss"
data-test-subj="test subject string"
>
<div
class="euiTableCellContent testClass1 testClass2 emotion-euiTestCss"
class="euiTableCellContent"
>
<span
class="euiTableCellContent__text"
Expand Down
6 changes: 3 additions & 3 deletions src/components/table/table_row_cell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,15 @@ export const EuiTableRowCell: FunctionComponent<Props> = ({
: [styles.desktop]),
];

const cellClasses = classNames('euiTableRowCell', {
const cellClasses = classNames('euiTableRowCell', className, {
'euiTableRowCell--hasActions': hasActions,
'euiTableRowCell--isExpander': isExpander,
'euiTableRowCell--hideForDesktop': mobileOptions.only,
'euiTableRowCell--enlargeForMobile': mobileOptions.enlarge,
[`euiTableRowCell--${valign}`]: valign,
});

const contentClasses = classNames('euiTableCellContent', className, {
const contentClasses = classNames('euiTableCellContent', {
'euiTableCellContent--alignRight': align === RIGHT_ALIGNMENT,
'euiTableCellContent--alignCenter': align === CENTER_ALIGNMENT,
'euiTableCellContent--showOnHover': showOnHover,
Expand All @@ -164,7 +164,7 @@ export const EuiTableRowCell: FunctionComponent<Props> = ({
'euiTableCellContent--overflowingContent': textOnly !== true,
});

const mobileContentClasses = classNames('euiTableCellContent', className, {
const mobileContentClasses = classNames('euiTableCellContent', {
'euiTableCellContent--alignRight':
mobileOptions.align === RIGHT_ALIGNMENT || align === RIGHT_ALIGNMENT,
'euiTableCellContent--alignCenter':
Expand Down

0 comments on commit 1065b0b

Please sign in to comment.