Skip to content
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

EuiTableRowCell overriding className prop #706

Closed
nreese opened this issue Apr 26, 2018 · 1 comment
Closed

EuiTableRowCell overriding className prop #706

nreese opened this issue Apr 26, 2018 · 1 comment
Assignees
Labels

Comments

@nreese
Copy link
Contributor

nreese commented Apr 26, 2018

EuiTableRowCell is overriding the className prop of children. This occurs when defining a column like so. The EuiLink does not retain the className prop.

{
  field: 'title',
  name: 'Title',
  render: (field, record) => (
    <EuiLink
      className="myClass"
      href="#"
    >
      click me
    </EuiLink>
  )
}

Work around is to just wrap child in another element.

cc @chandlerprall

@chandlerprall
Copy link
Contributor

I believe the right solution is to merge TableRowCell's childClasses into its cloned child element's className

modifiedChildren = React.Children.map(children, child => React.cloneElement(child, { className: childClasses }));

becomes

modifiedChildren = React.Children.map(children, child => React.cloneElement(child, { className: classNames(child.props.className, childClasses) }));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants