Skip to content

Commit

Permalink
Fixed a bug where table cell classes were being applied twice (#167)
Browse files Browse the repository at this point in the history
* update snapshots

* update snapshots and move ...rest to the div too

* link
  • Loading branch information
bevacqua authored Dec 1, 2017
1 parent 4f79d39 commit 0c28cbe
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
- Fixed bug where screen-reader styles weren't being imported [(#103)](https://github.com/elastic/eui/pull/103)
- Fixed a bug where `<progress>` wasn't being rendered under `block` display [(#166)](https://github.com/elastic/eui/pull/166)

**Breaking**

- Fixed a bug where table cell classes were being applied twice [(#167)](https://github.com/elastic/eui/pull/167)

# [`0.0.3`](https://github.com/elastic/eui/tree/v0.0.3)

- `<EuiFlexItem>` now accepts integers between 1 and 10 for the `grow` prop. [(#144)](https://github.com/elastic/eui/pull/144)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ exports[`align renders right when specified 1`] = `

exports[`renders EuiTableRowCell 1`] = `
<td
aria-label="aria-label"
class="euiTableRowCell testClass1 testClass2"
data-test-subj="test subject string"
class="euiTableRowCell"
>
<div
aria-label="aria-label"
class="euiTableCellContent testClass1 testClass2"
data-test-subj="test subject string"
>
<span
class="euiTableCellContent__text"
Expand Down
8 changes: 3 additions & 5 deletions src/components/table/table_row_cell.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,17 @@ export const EuiTableRowCell = ({
textOnly,
...rest
}) => {
const classes = classNames('euiTableRowCell', className);

const contentClasses = classNames('euiTableCellContent', className, {
'euiTableCellContent--alignRight': align === RIGHT_ALIGNMENT,
'euiTableCellContent--truncateText': truncateText,
// We're doing this rigamarole instead of creating `euiTableRowCell--textOnly` for BWC
// We're doing this rigamarole instead of creating `euiTableCellContent--textOnly` for BWC
// purposes for the time-being.
'euiTableCellContent--overflowingContent': !textOnly,
});

return (
<td className={classes} {...rest} >
<div className={contentClasses}>
<td className="euiTableRowCell">
<div className={contentClasses} {...rest}>
{
textOnly === true
? <span className="euiTableCellContent__text">{children}</span>
Expand Down

0 comments on commit 0c28cbe

Please sign in to comment.