Skip to content

[Flyout Menu] expand props for menu actions - #9992

Merged
tsullivan merged 8 commits into
elastic:mainfrom
tsullivan:flyout-menu-work/expand-action-button-props
Sep 3, 2026
Merged

tsullivan merged 8 commits into
elastic:mainfrom
tsullivan:flyout-menu-work/expand-action-button-props

Conversation

@tsullivan

@tsullivan tsullivan commented Sep 2, 2026 •

Copy link
Copy Markdown
Member

Summary

Closes #9934

What: Expands EuiFlyoutMenuAction (used by EuiFlyoutMenu's leadingActions/trailingActions) with isDisabled, isLoading, href, and target. onClick becomes optional so an action can navigate via href alone.

Why: There was no way to keep a flyout menu action visible but unavailable. Consumers had to either hide the action or leave it enabled and explain the failure after the click. Discover's document flyout needs a "Share direct link" action that is sometimes unavailable (insufficient permissions, unresolved row) and wants to say why.

How: MenuActionButton already renders an EuiButtonIcon, so the four props are forwarded to it directly and the existing toolTipContent carries the disabled reason.

One non-obvious decision: when an action is disabled (or loading) and has toolTipContent, the button is also given hasAriaDisabled. A natively disabled button is removed from the tab order, so keyboard and screen reader users could never reach the tooltip explaining why the action is unavailable. hasAriaDisabled keeps it focusable, which is the same approach EuiBasicTable takes for disabled row actions (default_item_action.tsx) and what our tooltip docs prescribe under "Disabled elements". It is scoped to disabled-with-tooltip so enabled actions render exactly as before.

API Changes

component / parent prop / child change description
EuiFlyoutMenuAction isDisabled Added Disables the action. Pair with toolTipContent to explain why it is unavailable
EuiFlyoutMenuAction isLoading Added Replaces the icon with a loading spinner and disables the action
EuiFlyoutMenuAction href Added Renders the action as an anchor, enabling right-click / open-in-new-tab
EuiFlyoutMenuAction target Added Anchor target. Only used when href is provided
EuiFlyoutMenuAction onClick Optional Was required; now optional so an action can navigate via href alone. Non-breaking (widening)

Screenshots

Flyout Menu Action States Demo

Impact Assessment

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

  • 🔴 Breaking changes — None. All four props are new and optional, and onClick moves from required to optional, which is a widening.
  • 💅 Visual changes — None to existing output. Two new VRT baselines are added for the new "Action states" story; no existing baselines changed. The disabled and loading appearances come from EuiButtonIcon's existing states.
  • 🧪 Test impact — Low. When an action is disabled/loading and has a tooltip, the button renders aria-disabled="true" instead of disabled. No existing consumer can hit this, because isDisabled/isLoading did not exist before this PR. Enabled actions are byte-identical.
  • 🔧 Hard to integrate — No. Purely additive and opt-in.

Impact level: 🟢 Low

Release Readiness

QA instructions for reviewer

Open Storybook → Layout/EuiFlyout/EuiFlyoutMenu → "Action states (href, isLoading, isDisabled)".

  • The share icon renders as an <a> — right-click offers "Open link in new tab", and its href/target="_blank" are present in the DOM.
  • Clicking the gear icon swaps its icon for a loading spinner for ~2s, during which it is not clickable.
  • The lock icon is disabled and hovering it shows "Insufficient permissions".
  • Keyboard: Tab reaches the lock icon and its tooltip appears on focus. This is the behavior hasAriaDisabled exists to enable — without it a disabled action is skipped entirely and the reason is unreachable.
  • Enter/Space on the focused lock icon does nothing.
  • Existing enabled actions in the other stories (Playground, Pagination) are unchanged.
Keyboard / a11y verification already performed (Chromium, via Playwright against the Storybook story)
Check Result
href renders as anchor ✅ <a href target="_blank" rel="noopener noreferrer"> — rel auto-secured by getSecureRelForTarget
Tab reaches all three actions ✅ including the disabled one (tabIndex: 0, aria-disabled="true", no native disabled)
Tooltip appears on keyboard focus ✅ for each action; only one tooltip in the DOM at a time
Tooltip dismisses on blur ✅
Enter / Space on the disabled action ✅ no events dispatched, focus retained, no navigation
Mouse click on the disabled action ✅ inert — Playwright reports "element is not enabled" from aria-disabled
isLoading swaps icon → spinner → icon ✅
isLoading preserves focus ✅ tabIndex: 0 throughout, so keyboard position is not lost when an action starts loading

Note

Known issue (pre-existing, not introduced here): hovering a disabled action shows its tooltip but the tooltip does not dismiss on mouse-out. EuiToolTip's anchor only neutralises pointer events for natively [disabled] elements, so aria-disabled ones swallow the mouseout that would hide it. It affects six other EUI call sites that already pair isDisabled with hasAriaDisabled. Tracked separately in #9997; the keyboard path is unaffected.

Relatedly, these action tooltips set disableScreenReaderOutput, so no aria-describedby is wired up and the disabled reason is shown visually but not announced. Worth a follow-up if we want the reason conveyed to assistive tech.

Checklist before marking Ready for Review

  • Filled out all sections above
  • QA: Tested light/dark modes, high contrast, mobile, Chrome/Safari/Edge/Firefox, keyboard-only, screen reader — keyboard-only verified in Chromium (see the table above); light/dark, high contrast, mobile, other browsers and screen reader still outstanding
  • QA: Tested in CodeSandbox and Kibana
  • QA: Tested docs changes
  • Tests: Added/updated Jest and VRT — 5 new Jest cases covering isDisabled, isLoading, href and target, plus baselines for the new story. No Cypress spec added; the keyboard path is covered manually per the QA steps above.
  • Changelog: Added changelog entry
  • Breaking changes: Added breaking change label (if applicable) — N/A

Reviewer checklist

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

@tsullivan
tsullivan marked this pull request as ready for review September 2, 2026 23:23
@tsullivan
tsullivan requested a review from a team as a code owner September 2, 2026 23:23
Copilot AI lite review requested due to automatic review settings September 2, 2026 23:23

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.

🟡 Changes recommended

A few newly added/updated comments/docs contain inaccuracies/omissions that should be corrected to avoid misleading guidance.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR expands EuiFlyoutMenuAction (used by EuiFlyoutMenu’s leadingActions/trailingActions) to support disabled/loading states and link navigation, and updates the docs/examples/tests to reflect the new API.

Changes:

  • Extend EuiFlyoutMenuAction with isDisabled, isLoading, href, and target, and make onClick optional.
  • Update flyout menu action rendering to forward the new props to EuiButtonIcon (including hasAriaDisabled behavior when tooltips are present).
  • Add docs prop table generation + documentation updates, plus new Storybook story and Jest coverage for the new behavior.
File summaries
File Description
packages/website/docs/components/containers/flyout/index.mdx Adds a prop table entry for the EuiFlyoutMenuAction type docgen output.
packages/website/docs/components/containers/flyout/_flyout_menu.mdx Documents the newly supported action props and links to the new prop table.
packages/eui/src/components/flyout/flyout_menu/types.ts Expands the EuiFlyoutMenuAction interface and updates inline doc comments.
packages/eui/src/components/flyout/flyout_menu/types.docgen.tsx Adds a docgen-only component wrapper so react-docgen-typescript can extract interface prop docs.
packages/eui/src/components/flyout/flyout_menu/action_button.tsx Forwards new action props into EuiButtonIcon and sets hasAriaDisabled for tooltip-on-disabled behavior.
packages/eui/src/components/flyout/flyout_menu.test.tsx Adds Jest coverage for disabled, loading, and href/target rendering.
packages/eui/src/components/flyout/flyout_menu.stories.tsx Adds a new “Action states” story demonstrating href/loading/disabled states.
packages/eui/changelogs/upcoming/9992.md Adds changelog entries describing the new props and optional onClick.
Review details
  • Files reviewed: 8/10 changed files
  • Comments generated: 3
  • Review effort level: Lite

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

@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! 🟢 Thanks, @tsullivan (aka Sully 😄)

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

@tsullivan
tsullivan merged commit 1a1362c into elastic:main Sep 3, 2026
7 checks passed
Dosant added a commit to elastic/kibana that referenced this pull request Sep 11, 2026
Part of elastic/eui-private#766

Staged commits cherry-picked from:
- #287310
- #288418
- #235177

## Dependency updates

`@elastic/eui` - 120.0.0 ⏩ 121.0.0
`@elastic/eui-test-helpers` - 1.5.0-snapshot ⏩ 1.6.0

> [!WARNING]
> `EuiHeaderLogo`: `iconType` is removed and `children` text is no
longer rendered. Use `logoType` (`glyph` or `horizontal`). Staged in
#288418.

Also in this PR:
- `EuiButtonGroup` Children API migrations and snapshot updates from
#287310
- New i18n token `euiTimeWindowButtons.label` (`Time window controls`)

## Package updates

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

- Added `isDisabled`, `isLoading`, `href`, and `target` props to
`EuiFlyoutMenuAction`.
([#9992](elastic/eui#9992))
- Updated `onClick` on `EuiFlyoutMenuAction` to be optional, so actions
can navigate via `href` alone.
([#9992](elastic/eui#9992))
- Added `tableSparkles` icon
([#9987](elastic/eui#9987))
- Updated styles of `EuiFilterButton`
([#9961](elastic/eui#9961))
- Updated `EuiFilterGroup`
([#9961](elastic/eui#9961))
    - Updated styles
- Added `display` prop (values: `'regular' | 'highlighted'`) to render
different visual toggle variants
- Added `showDividers` prop to optionally render dividers between group
children
- Updated `EuiSplitButton` disabled styles
([#9986](elastic/eui#9986))
- Updated styles on `EuiButtonGroup` with legacy Options API
([#9953](elastic/eui#9953))
- Updated usages of `EuiButtonGroup` in `EuiDataGrid`'s display selector
and column sorting to use the Children API
([#9953](elastic/eui#9953))
- Updated `EuiSuperDatePicker`'s time window buttons to use
`EuiButtonGroup` with Children API
([#9953](elastic/eui#9953))

**Bug fixes**

- Fixed `EuiPopoverTitle` and `EuiPopoverFooter` backgrounds not
following the popover panel's corner radius
([#9985](elastic/eui#9985))
- Fixed `EuiFlyoutBody` content becoming inaccessible at short viewport
heights ([#9944](elastic/eui#9944))

**Deprecations**

- Deprecated `options` on `EuiButtonGroup` - Use the new Children API
via `children` prop instead.
([#9953](elastic/eui#9953))
- Deprecated `color` on `EuiButtonGroup` - `color` will be fixed to
`text` in the future.
([#9953](elastic/eui#9953))
- Deprecated `buttonSize="compressed"` on `EuiButtonGroup` - Renders as
`buttonSize="s"` instead.
([#9953](elastic/eui#9953))

**Breaking changes**

- Added a new `logoType` prop to `EuiHeaderLogo` to render either the
`glyph` or `horizontal` Elastic logo. The `iconType` prop has been
removed, and `children` text content is no longer rendered.
([#9875](elastic/eui#9875))

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

- Added `EuiPopoverObject`, a Playwright Component Object for
`EuiPopover` ([#9993](elastic/eui#9993))
- Added `EuiFlyoutObject`, a Playwright Component Object for `EuiFlyout`
([#9994](elastic/eui#9994))
- Added `EuiModalObject`, a Playwright Component Object for
`EuiModal`/`EuiConfirmModal`
([#10002](elastic/eui#10002))
- Added `EuiAccordionObject`, a Playwright Component Object for
`EuiAccordion` ([#10003](elastic/eui#10003))

**Bug fixes**

- Fixed `EuiComboBoxObject.clear()` and `setSelectedOptions()` timing
out on `singleSelection` combo boxes, whose pills have no close button
([#9998](elastic/eui#9998))

---------

Co-authored-by: Lene Gadewoll <[email protected]>
Co-authored-by: JoseLuisGJ <[email protected]>
ppisljar pushed a commit to ppisljar/kibana that referenced this pull request Sep 21, 2026
Part of elastic/eui-private#766

Staged commits cherry-picked from:
- elastic#287310
- elastic#288418
- elastic#235177

## Dependency updates

`@elastic/eui` - 120.0.0 ⏩ 121.0.0
`@elastic/eui-test-helpers` - 1.5.0-snapshot ⏩ 1.6.0

> [!WARNING]
> `EuiHeaderLogo`: `iconType` is removed and `children` text is no
longer rendered. Use `logoType` (`glyph` or `horizontal`). Staged in
elastic#288418.

Also in this PR:
- `EuiButtonGroup` Children API migrations and snapshot updates from
elastic#287310
- New i18n token `euiTimeWindowButtons.label` (`Time window controls`)

## Package updates

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

- Added `isDisabled`, `isLoading`, `href`, and `target` props to
`EuiFlyoutMenuAction`.
([elastic#9992](elastic/eui#9992))
- Updated `onClick` on `EuiFlyoutMenuAction` to be optional, so actions
can navigate via `href` alone.
([elastic#9992](elastic/eui#9992))
- Added `tableSparkles` icon
([elastic#9987](elastic/eui#9987))
- Updated styles of `EuiFilterButton`
([elastic#9961](elastic/eui#9961))
- Updated `EuiFilterGroup`
([elastic#9961](elastic/eui#9961))
    - Updated styles
- Added `display` prop (values: `'regular' | 'highlighted'`) to render
different visual toggle variants
- Added `showDividers` prop to optionally render dividers between group
children
- Updated `EuiSplitButton` disabled styles
([elastic#9986](elastic/eui#9986))
- Updated styles on `EuiButtonGroup` with legacy Options API
([elastic#9953](elastic/eui#9953))
- Updated usages of `EuiButtonGroup` in `EuiDataGrid`'s display selector
and column sorting to use the Children API
([elastic#9953](elastic/eui#9953))
- Updated `EuiSuperDatePicker`'s time window buttons to use
`EuiButtonGroup` with Children API
([elastic#9953](elastic/eui#9953))

**Bug fixes**

- Fixed `EuiPopoverTitle` and `EuiPopoverFooter` backgrounds not
following the popover panel's corner radius
([elastic#9985](elastic/eui#9985))
- Fixed `EuiFlyoutBody` content becoming inaccessible at short viewport
heights ([elastic#9944](elastic/eui#9944))

**Deprecations**

- Deprecated `options` on `EuiButtonGroup` - Use the new Children API
via `children` prop instead.
([elastic#9953](elastic/eui#9953))
- Deprecated `color` on `EuiButtonGroup` - `color` will be fixed to
`text` in the future.
([elastic#9953](elastic/eui#9953))
- Deprecated `buttonSize="compressed"` on `EuiButtonGroup` - Renders as
`buttonSize="s"` instead.
([elastic#9953](elastic/eui#9953))

**Breaking changes**

- Added a new `logoType` prop to `EuiHeaderLogo` to render either the
`glyph` or `horizontal` Elastic logo. The `iconType` prop has been
removed, and `children` text content is no longer rendered.
([elastic#9875](elastic/eui#9875))

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

- Added `EuiPopoverObject`, a Playwright Component Object for
`EuiPopover` ([elastic#9993](elastic/eui#9993))
- Added `EuiFlyoutObject`, a Playwright Component Object for `EuiFlyout`
([elastic#9994](elastic/eui#9994))
- Added `EuiModalObject`, a Playwright Component Object for
`EuiModal`/`EuiConfirmModal`
([elastic#10002](elastic/eui#10002))
- Added `EuiAccordionObject`, a Playwright Component Object for
`EuiAccordion` ([elastic#10003](elastic/eui#10003))

**Bug fixes**

- Fixed `EuiComboBoxObject.clear()` and `setSelectedOptions()` timing
out on `singleSelection` combo boxes, whose pills have no close button
([elastic#9998](elastic/eui#9998))

---------

Co-authored-by: Lene Gadewoll <[email protected]>
Co-authored-by: JoseLuisGJ <[email protected]>
weronikaolejniczak pushed a commit to boriskirov/eui that referenced this pull request Nov 11, 2026
Co-authored-by: kibanamachine <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
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.

[EuiFlyout] Support disabling leadingActions/trailingActions items in EuiFlyoutMenu

4 participants