Skip to content

[EuiDataGrid] Fix header cell actions popover not opening on pressing Enter on the menu button - #9931

Merged
mgadewoll merged 5 commits into
elastic:mainfrom
mgadewoll:datagrid/fix-overlapping-actions-handler-execution
Aug 21, 2026
Merged

mgadewoll merged 5 commits into
elastic:mainfrom
mgadewoll:datagrid/fix-overlapping-actions-handler-execution

Conversation

@mgadewoll

@mgadewoll mgadewoll commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • What: Fixes the header cell executing two individual handlers on Enter press that control the popover open state.
  • Why:
    • On pressing Enter on the focused action menu button, two handlers would execute that both set the popover state via setIsPopoverOpen which would result in the popover opening and closing immediately.
    • This likely was a cause for the flaky cypress test behavior in focus_utils.spec.tsx (e.g. seen here)
  • How:
    • Adds a e.target === e.currentTarget guard to openActionsPopoverOnEnter in ColumnActions.
  • Additional notes:
    • this PR also attempts to stabilize draggable_columns.spec.ts (e.g. seen here)

API Changes

⚪ No API changes

Screenshots

Before After
Screen.Recording.2026-08-19.at.14.43.11.mov
Screen.Recording.2026-08-19.at.14.44.06.mov

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

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

  • verify the menu popover opens on Enter key press when the action menu button is focused:
    • click a header cell
    • click the action menu button -> popover should open
    • press Escape -> popover should close and menu button should be focused
    • press Enter -> popover should open (this step does not work on production)
  • multiple CI runs finish green without failure in focus_utils.spec.tsx and draggable_columns.spec.tsx

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.

@mgadewoll mgadewoll self-assigned this Aug 19, 2026
@mgadewoll
mgadewoll force-pushed the datagrid/fix-overlapping-actions-handler-execution branch from f230887 to a7da057 Compare August 19, 2026 12:59
@mgadewoll
mgadewoll requested a lite review from Copilot August 19, 2026 13:41

Copilot AI left a comment

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.

Pull request overview

Fixes an EuiDataGrid header-cell keyboard interaction where pressing Enter on the column actions menu button could immediately re-close the popover due to multiple Enter-related handlers firing and competing over popover state.

Changes:

  • Prevents the header cell’s Enter key handler from running when the Enter event originates from the nested actions button (via an e.target === e.currentTarget guard).
  • Strengthens the Cypress focus/keyboard regression test by asserting the actions button is focused after closing the popover with Escape.
  • Adds a changelog entry documenting the bug fix.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
packages/eui/src/components/datagrid/body/header/column_actions.tsx Avoids Enter key event bubbling from the nested actions button causing conflicting popover state updates.
packages/eui/src/components/datagrid/body/cell/focus_utils.spec.tsx Adds a focus assertion to reduce flakiness and validate expected keyboard focus behavior.
packages/eui/changelogs/upcoming/9931.md Documents the EuiDataGrid header actions popover Enter key fix.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@mgadewoll

Copy link
Copy Markdown
Contributor Author

buildkite test this

2 similar comments
@mgadewoll

Copy link
Copy Markdown
Contributor Author

buildkite test this

@mgadewoll

Copy link
Copy Markdown
Contributor Author

buildkite test this

@mgadewoll

Copy link
Copy Markdown
Contributor Author

buildkite test this

1 similar comment
@mgadewoll

Copy link
Copy Markdown
Contributor Author

buildkite test this

@mgadewoll
mgadewoll marked this pull request as ready for review August 21, 2026 07:16
@mgadewoll
mgadewoll requested a review from a team as a code owner August 21, 2026 07:16
@mgadewoll mgadewoll mentioned this pull request Aug 21, 2026
1 task done
cy.realMount(<StatefulDataGrid />);

cy.get('[data-test-subj=dataGridHeaderCell-a]').realClick();
cy.get('[data-test-subj=dataGridHeaderCell-a]').click();

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.

non-blocking question: Do we need to change realClick to click and why?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The issue was a batch timing issue which click sidesteps.
That being said, I think we can solve this more elegantly by adding a should('be.focused') guard that includes a retry.
Updated in 10d34fb

@weronikaolejniczak weronikaolejniczak left a comment

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.

LGTM! 🟢 Thank you for addressing this so quickly 🙏🏻 Let's see if this stabilizes the test too.

@mgadewoll

Copy link
Copy Markdown
Contributor Author

buildkite test this

1 similar comment
@mgadewoll

Copy link
Copy Markdown
Contributor Author

buildkite test this

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

cc @mgadewoll

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

cc @mgadewoll

@mgadewoll
mgadewoll merged commit 8a16358 into elastic:main Aug 21, 2026
1 check passed
mgadewoll added a commit to elastic/kibana that referenced this pull request Aug 28, 2026
## Dependency updates

`@elastic/eui` - 119.0.0 ⏩ 119.1.0
`@elastic/eui-test-helpers` - 1.3.0 ⏩ 1.4.0

## Changes

- Updated usages of `EuiFilePickerClass` to `EuiFilePickerRef` after the
migration of `EuiFilePicker` from class to function component

## Package updates

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

- Updated `EuiFlyoutMenu` action icon spacing: `leadingActions` and
`trailingActions` icons are now grouped with a consistent gap between
each icon ([#9887](elastic/eui#9887))
- Updated `EuiFlyoutMenu` back button to show a tooltip with the
previous page title (e.g. "Back to Page 1") when history context is
available ([#9887](elastic/eui#9887))
- Added `cursorDefault`, `logIn`, and `routeSplit` glyphs to `EuiIcon`
([#9885](elastic/eui#9885))
- Updated `EuiSplitButton` to apply redesign style changes
([#9865](elastic/eui#9865))
- Added a development warning to `useGeneratedHtmlId` and
`htmlIdGenerator` when the passed `prefix`/`suffix` contains whitespace,
which generates invalid HTML IDs
([#9868](elastic/eui#9868))
- Updated `EuiButtonGroup`:
([#9862](elastic/eui#9862))
- Added `variant="segmented"` which renders the group as visually
connected control group
- Added `showDividers` prop to optionally render dividers between group
children
- Added `layout` prop to optionally render icon button groups vertically
    - Added `wrap` prop to manually control the group wrapping behavior

**Bug fixes**

- Fixed `EuiDataGrid` header cell actions popover not opening when
pressing Enter on a focused actions button
([#9931](elastic/eui#9931))
- Fixed `EuiFilePicker` losing imperative `ref` support when migrated
from class to function component
([#9879](elastic/eui#9879)). Use
`useRef<EuiFilePickerRef>()` where `useRef<EuiFilePickerClass>()` was
previously used. ([#9930](elastic/eui#9930))
- Fixed `EuiSplitButton` having a wrong `inline-size` when
`textProps={false}` is set on an action button that has `iconType`
([#9917](elastic/eui#9917))

### `@elastic/eui-test-helpers`
[v1.4.0](https://github.com/elastic/eui/blob/main/packages/test-helpers/changelogs/CHANGELOG_2026.md)

- Added `EuiSelectableObject` with `options`, `selectOption(label)` and
`search(term)` ([#9908](elastic/eui#9908))

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Hannah Mudge <[email protected]>
dej611 pushed a commit to dej611/kibana that referenced this pull request Aug 31, 2026
## Dependency updates

`@elastic/eui` - 119.0.0 ⏩ 119.1.0
`@elastic/eui-test-helpers` - 1.3.0 ⏩ 1.4.0

## Changes

- Updated usages of `EuiFilePickerClass` to `EuiFilePickerRef` after the
migration of `EuiFilePicker` from class to function component

## Package updates

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

- Updated `EuiFlyoutMenu` action icon spacing: `leadingActions` and
`trailingActions` icons are now grouped with a consistent gap between
each icon ([elastic#9887](elastic/eui#9887))
- Updated `EuiFlyoutMenu` back button to show a tooltip with the
previous page title (e.g. "Back to Page 1") when history context is
available ([elastic#9887](elastic/eui#9887))
- Added `cursorDefault`, `logIn`, and `routeSplit` glyphs to `EuiIcon`
([elastic#9885](elastic/eui#9885))
- Updated `EuiSplitButton` to apply redesign style changes
([elastic#9865](elastic/eui#9865))
- Added a development warning to `useGeneratedHtmlId` and
`htmlIdGenerator` when the passed `prefix`/`suffix` contains whitespace,
which generates invalid HTML IDs
([elastic#9868](elastic/eui#9868))
- Updated `EuiButtonGroup`:
([elastic#9862](elastic/eui#9862))
- Added `variant="segmented"` which renders the group as visually
connected control group
- Added `showDividers` prop to optionally render dividers between group
children
- Added `layout` prop to optionally render icon button groups vertically
    - Added `wrap` prop to manually control the group wrapping behavior

**Bug fixes**

- Fixed `EuiDataGrid` header cell actions popover not opening when
pressing Enter on a focused actions button
([elastic#9931](elastic/eui#9931))
- Fixed `EuiFilePicker` losing imperative `ref` support when migrated
from class to function component
([elastic#9879](elastic/eui#9879)). Use
`useRef<EuiFilePickerRef>()` where `useRef<EuiFilePickerClass>()` was
previously used. ([elastic#9930](elastic/eui#9930))
- Fixed `EuiSplitButton` having a wrong `inline-size` when
`textProps={false}` is set on an action button that has `iconType`
([elastic#9917](elastic/eui#9917))

### `@elastic/eui-test-helpers`
[v1.4.0](https://github.com/elastic/eui/blob/main/packages/test-helpers/changelogs/CHANGELOG_2026.md)

- Added `EuiSelectableObject` with `options`, `selectOption(label)` and
`search(term)` ([elastic#9908](elastic/eui#9908))

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Hannah Mudge <[email protected]>
weronikaolejniczak pushed a commit to boriskirov/eui that referenced this pull request Nov 11, 2026
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

Successfully merging this pull request may close these issues.

3 participants