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

EuiBasicTable's DefaultItemAction with IconFunction crashes when collapsed #3144

Closed
crux153 opened this issue Mar 22, 2020 · 0 comments
Closed

Comments

@crux153
Copy link
Contributor

crux153 commented Mar 22, 2020

While DefaultItemAction accepts a function to dynamically change icon value as like below,

type IconFunction<T> = (item: T) => EuiIconType;
export interface DefaultItemIconButtonAction<T>
  extends DefaultItemActionBase<T> {
  type: 'icon';
  icon: EuiIconType | IconFunction<T>;
  color?: EuiButtonIconColor | EuiButtonIconColorFunction<T>;
}

It crashes when shown in CollapsedItemActions component, due to its resolver only presents in DefaultItemAction component.

{
    name: 'Clone',
    description: 'Clone this user',
    icon: item => (item.online ? 'eye' : 'eyeClosed'),
    onClick: this.cloneUser,
    'data-test-subj': 'action-clone',
}

Screen Shot 2020-03-22 at 4 43 49 PM

If I pass an action with dynamic icon value like above, the table crashes when clicking the expand button in action column.

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

No branches or pull requests

1 participant