Skip to content

EuiBasicTable's DefaultItemAction with IconFunction crashes when collapsed #3144

@crux153

Description

@crux153

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions