diff --git a/CHANGELOG.md b/CHANGELOG.md index c7739225ab9..e29bd79d846 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ - Added `!default` to SASS variables of `EuiCollapsibleNav` ([#4335](https://github.com/elastic/eui/pull/4335)) - Fixed `EuiDataGrid` column property `displayAsText`. Column headers prefer `displayAsText` over `id`; `display` still takes precedence. If provided, the filter in the sort-popover will search against `displayAsText` instead of `id`. ([#4351](https://github.com/elastic/eui/pull/4351)) - Fixed propagation of `esc` key presses closing parent popovers ([#4336](https://github.com/elastic/eui/pull/4336)) +- Fixed overwritten `isDisabled` prop on `EuiListGroupItem` `extraAction` config ([#4359](https://github.com/elastic/eui/pull/4359)) **Theme: Amsterdam** diff --git a/src/components/list_group/__snapshots__/list_group_item.test.tsx.snap b/src/components/list_group/__snapshots__/list_group_item.test.tsx.snap index 3c776e89d9b..b1ee532ca93 100644 --- a/src/components/list_group/__snapshots__/list_group_item.test.tsx.snap +++ b/src/components/list_group/__snapshots__/list_group_item.test.tsx.snap @@ -102,6 +102,34 @@ exports[`EuiListGroupItem props color text is rendered 1`] = ` `; +exports[`EuiListGroupItem props extraAction can be disabled 1`] = ` +
  • + + + Label + + + +
  • +`; + exports[`EuiListGroupItem props extraAction is rendered 1`] = `
  • { expect(component).toMatchSnapshot(); }); + + test('can be disabled', () => { + const component = render( + + ); + + expect(component).toMatchSnapshot(); + }); }); describe('href', () => { diff --git a/src/components/list_group/list_group_item.tsx b/src/components/list_group/list_group_item.tsx index b8be3d864ce..ea22d918bc6 100644 --- a/src/components/list_group/list_group_item.tsx +++ b/src/components/list_group/list_group_item.tsx @@ -196,7 +196,13 @@ export const EuiListGroupItem: FunctionComponent = ({ let extraActionNode; if (extraAction) { - const { iconType, alwaysShow, className, ...rest } = extraAction; + const { + iconType, + alwaysShow, + className, + isDisabled: actionIsDisabled, + ...rest + } = extraAction; const extraActionClasses = classNames( 'euiListGroupItem__extraAction', @@ -211,7 +217,7 @@ export const EuiListGroupItem: FunctionComponent = ({ className={extraActionClasses} iconType={iconType} {...rest} - disabled={isDisabled} + disabled={isDisabled || actionIsDisabled} /> ); }