Skip to content

fix(EuiDataGrid): don't apply icon color to disabled cell action buttons #9672

Merged
tkajtoch merged 6 commits into
elastic:mainfrom
tkajtoch:fix/datagrid-cell-action-disabled-state-icon-color
May 26, 2026
Merged

fix(EuiDataGrid): don't apply icon color to disabled cell action buttons #9672
tkajtoch merged 6 commits into
elastic:mainfrom
tkajtoch:fix/datagrid-cell-action-disabled-state-icon-color

Conversation

@tkajtoch
Copy link
Copy Markdown
Member

@tkajtoch tkajtoch commented May 21, 2026

Summary

This PR addresses an issue in style overrides applied to EuiButtonIcon when rendering EuiDataGrid cell actions. Previously, when disabled or isDisabled were passed to the cell action's <Component>, the style overrides made it look like a regular, not disabled button icon. This fix makes these styles apply only for non-disabled button icons as the disabled state always uses the same icon color no matter the color set.

API Changes

N/A

Screenshots

On both screenshots the mail button icon has isDisabled applied.

Before After
Screenshot 2026-05-21 at 12 22 34 Screenshot 2026-05-21 at 12 20 32

Impact Assessment

Note: Most PRs should be tested in Kibana to help gauge their Impact before merging.

  • 🔴 Breaking changes — What will break? How many usages in Kibana/Cloud UI are impacted?
  • 💅 Visual changes — May impact style overrides; could require visual testing. Explain and estimate impact.
  • 🧪 Test impact — May break functional or snapshot tests (e.g., HTML structure, class names, default values).
  • 🔧 Hard to integrate — If changes require substantial updates to Kibana, please stage the changes and link them here.

Impact level: 🟢 None to Low

Release Readiness

  • Documentation: {link to docs page(s)}
  • Figma: {link to Figma or issue}
  • Migration guide: {steps or link, for breaking/visual changes or deprecations}
  • Adoption plan (new features): {link to issue/doc or outline who will integrate this and where}

QA instructions for reviewer

import React, { useState, useCallback } from 'react';
import { EuiDataGrid, EuiAvatar } from '@elastic/eui';
import { faker } from '@faker-js/faker';

const columns = [
  {
    id: 'avatar',
    initialWidth: 40,
    isResizable: false,
    actions: false,
  },
  {
    id: 'name',
    initialWidth: 100,
    isSortable: true,
    actions: {
      showHide: false,
    },
  },
  {
    id: 'email',
    isSortable: true,
    cellActions: [
      ({ rowIndex, columnId, Component, closePopover }) => {
        const row = ++rowIndex;
        return (
          <Component
            isDisabled
            onClick={() => {
              alert(`Love sent from row ${row}, column "${columnId}"`);
              closePopover();
            }}
            iconType="heart"
            aria-label={`Send love to ${row}, column "${columnId}" `}
          >
            Send love
          </Component>
        );
      },
    ],
  },
  {
    id: 'city',
    isSortable: true,
    cellActions: [
      ({ rowIndex, columnId, Component, isExpanded }) => {
        const row = ++rowIndex;
        const message = isExpanded
          ? `Cheers sent in Popover to row "${row}" column "${columnId}"`
          : `Cheers sent from row ${row}, column "${columnId}"`;

        return (
          <Component
            onClick={() => alert(message)}
            iconType="popper"
            aria-label={message}
          >
            Cheer
          </Component>
        );
      },
    ],
  },
  {
    id: 'country',
    cellActions: [
      ({ rowIndex, columnId, Component }) => {
        const row = ++rowIndex;
        const label = `Love sent from row ${row}, column "${columnId}"`;
        return (
          <Component
            onClick={() =>
              alert(`Love sent from row ${row}, column "${columnId}"`)
            }
            iconType="heart"
            aria-label={label}
          >
            Love this city
          </Component>
        );
      },
      ({ rowIndex, columnId, Component }) => {
        const row = ++rowIndex;
        const label = `Paint country at row ${row}, column "${columnId}"`;
        return (
          <Component
            onClick={() =>
              alert(`Paint sent from row ${row}, column "${columnId}"`)
            }
            iconType="brush"
            aria-label={label}
          >
            Paint this city
          </Component>
        );
      },
    ],
  },
  {
    id: 'account',
  },
];

const data = [];

for (let i = 1; i < 5; i++) {
  data.push({
    avatar: (
      <EuiAvatar
        size="s"
        name={`${faker.person.lastName()}, ${faker.person.firstName()}`}
      />
    ),
    name: `${faker.person.lastName()}, ${faker.person.firstName()} ${faker.person.suffix()}`,
    email: faker.internet.email(),
    city: faker.location.city(),
    country: faker.location.country(),
    account: faker.finance.accountNumber(),
  });
}

export default () => {
  const [pagination, setPagination] = useState({ pageIndex: 0 });

  const [visibleColumns, setVisibleColumns] = useState(
    columns.map(({ id }) => id)
  );

  const setPageIndex = useCallback(
    (pageIndex) =>
      setPagination((pagination) => ({ ...pagination, pageIndex })),
    []
  );
  const setPageSize = useCallback(
    (pageSize) =>
      setPagination((pagination) => ({
        ...pagination,
        pageSize,
        pageIndex: 0,
      })),
    []
  );

  return (
    <EuiDataGrid
      aria-label="DataGrid demonstrating column sizing constraints"
      columns={columns}
      columnVisibility={{
        visibleColumns: visibleColumns,
        setVisibleColumns: setVisibleColumns,
      }}
      rowCount={data.length}
      renderCellValue={({ rowIndex, columnId }) => data[rowIndex][columnId]}
      pagination={{
        ...pagination,
        onChangeItemsPerPage: setPageSize,
        onChangePage: setPageIndex,
      }}
    />
  );
};

Checklist before marking Ready for Review

Reviewer checklist

  • Approved Impact Assessment — Acceptable to merge given the consumer impact.
  • Approved Release Readiness — Docs, Figma, and migration info are sufficient to ship.

@tkajtoch tkajtoch self-assigned this May 21, 2026
@tkajtoch tkajtoch added the support-duty-flywheel Label for PRs, see eui-private #310 label May 21, 2026
@tkajtoch tkajtoch marked this pull request as ready for review May 26, 2026 10:07
@tkajtoch tkajtoch requested a review from a team as a code owner May 26, 2026 10:07
@mgadewoll mgadewoll self-requested a review May 26, 2026 10:09
}

/* Force all cell action buttons to match EUI colors unless disabled */
&:not(:disabled),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering that EUI buttons support hasAriaDisabled we should use euiDisabledSelector that includes aria-disabled as well.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Updated in e1d3f75

@elasticmachine
Copy link
Copy Markdown
Collaborator

💚 Build Succeeded

History

cc @tkajtoch

@elasticmachine
Copy link
Copy Markdown
Collaborator

💚 Build Succeeded

History

cc @tkajtoch

Copy link
Copy Markdown
Contributor

@mgadewoll mgadewoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 LGTM. I can confirm that the grid action button icons are now correctly displayed as disabled.

@tkajtoch tkajtoch merged commit f494fd1 into elastic:main May 26, 2026
5 checks passed
acstll added a commit to elastic/kibana that referenced this pull request May 27, 2026
## Dependency updates

- `@elastic/eui` - v116.1.0 ⏩ v116.2.0

---

## Package updates

### @elastic/eui
[`v116.2.0`](https://github.com/elastic/eui/blob/main/packages/eui/changelogs/CHANGELOG_2026.md)

- Added experimental support for always-visible sticky horizontal
scrollbars in `EuiTable`, `EuiBasicTable` and `EuiInMemoryTable` useful
for dense tables that exceed the height of the viewport. This feature is
currently opt-in and can be enabled by setting `stickyScrollbar: true`.
([#9674](elastic/eui#9674))
- Added `significantEvents` glyph to `EuiIcon`
([#9665](elastic/eui#9665))

**Bug fixes**

- Fixed `EuiDataGrid` incorrectly styling disabled `cellActions` icon
buttons and making them look like they were not disabled
([#9672](elastic/eui#9672))
- Fixed a visual misalignment on `EuiSelectableTemplateSitewide` list
items when search terms are highlighted
([#9669](elastic/eui#9669))

**Dependency updates**

- Updated `uuid` to v14.0.0
([#9663](elastic/eui#9663))

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
smith pushed a commit to smith/kibana that referenced this pull request May 27, 2026
## Dependency updates

- `@elastic/eui` - v116.1.0 ⏩ v116.2.0

---

## Package updates

### @elastic/eui
[`v116.2.0`](https://github.com/elastic/eui/blob/main/packages/eui/changelogs/CHANGELOG_2026.md)

- Added experimental support for always-visible sticky horizontal
scrollbars in `EuiTable`, `EuiBasicTable` and `EuiInMemoryTable` useful
for dense tables that exceed the height of the viewport. This feature is
currently opt-in and can be enabled by setting `stickyScrollbar: true`.
([elastic#9674](elastic/eui#9674))
- Added `significantEvents` glyph to `EuiIcon`
([elastic#9665](elastic/eui#9665))

**Bug fixes**

- Fixed `EuiDataGrid` incorrectly styling disabled `cellActions` icon
buttons and making them look like they were not disabled
([elastic#9672](elastic/eui#9672))
- Fixed a visual misalignment on `EuiSelectableTemplateSitewide` list
items when search terms are highlighted
([elastic#9669](elastic/eui#9669))

**Dependency updates**

- Updated `uuid` to v14.0.0
([elastic#9663](elastic/eui#9663))

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

support-duty-flywheel Label for PRs, see eui-private #310

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants