Skip to content

[EuiSplitButton] Fix inline-size behavior - #9917

Merged
mgadewoll merged 2 commits into
elastic:mainfrom
mgadewoll:splitbutton/fix-inline-size-behavior
Aug 14, 2026
Merged

mgadewoll merged 2 commits into
elastic:mainfrom
mgadewoll:splitbutton/fix-inline-size-behavior

Conversation

@mgadewoll

@mgadewoll mgadewoll commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • What: Fixes EuiSplitButton width collapsing for icon + text usage.
  • Why: This is a follow-up to changes done in [EuiSplitButton] Implement redesign #9865.
  • How:
    • Replaces the :only-child selector with a direct class selector. The issue is that :only-child counts nodes, but if textProps={false} is set on buttons, the inner EuiButtonDisplayContent skips the render node and renders text as string. That would result in icon-only inline-size being applied and the button looking collapsed.
    • adds a max-inline-size to the group element to prevent unwanted stretching

API Changes

⚪ No API changes

Screenshots

Before After
Screenshot 2026-08-14 at 10 26 42 Screenshot 2026-08-14 at 10 31 42
Screenshot 2026-08-14 at 10 42 52 Screenshot 2026-08-14 at 10 43 10

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

🧪 The changes have been run in Kibana CI (🟢 build)

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

💻 Storybook

  • verify there are no unexpected regressions with production
  • (optional) checkout this PR and manually verify the new style fixes the issues:
    • update e.g. the "Playground" story to render <EuiSplitButton.ActionPrimary iconType="faceHappy" textProps={false}>
    • revert the PR style changes and compare styles between previous and new state and verify the :has(svg:only-child) style is not applied

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.

- :only-child doesn't account for string only text
@mgadewoll mgadewoll self-assigned this Aug 14, 2026
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
44 visual difference(s) found - expand to review, then click Approve visual changes to update baselines

euiicon (2 differences)

StoryBeforeAfterDiff
all icons desktop
all icons mobile

euicombobox (9 differences)

StoryBeforeAfterDiff
custom matcher desktop
custom truncation desktop
default truncation desktop
groups desktop
icons and many options selected desktop
nested options groups desktop
playground desktop
row height auto desktop
with tooltip desktop

euiform (1 difference)

StoryBeforeAfterDiff
playground mobile

euiinlineedittext (2 differences)

StoryBeforeAfterDiff
edit mode mobile
playground mobile

euiflexgrid (1 difference)

StoryBeforeAfterDiff
playground desktop

euiflyout (14 differences)

StoryBeforeAfterDiff
playground desktop
playground mobile
playground desktop
playground mobile
playground desktop
playground mobile
playground desktop
playground mobile
pagination example desktop
pagination example mobile
playground desktop
playground mobile
playground desktop
playground mobile

euiheader (4 differences)

StoryBeforeAfterDiff
elastic navigation pattern desktop
elastic navigation pattern mobile
multiple fixed headers mobile
popover example mobile

euicollapsiblenav (4 differences)

StoryBeforeAfterDiff
full header pattern desktop
full header pattern mobile
playground desktop
playground mobile

euicontextmenu (1 difference)

StoryBeforeAfterDiff
playground desktop

euikeypadmenu (1 difference)

StoryBeforeAfterDiff
playground mobile

euidatagrid (4 differences)

StoryBeforeAfterDiff
full screen with flyout mobile
column selector desktop
column selector mobile
toolbar visibility options desktop

euitable (1 difference)

StoryBeforeAfterDiff
playground mobile

@mgadewoll

Copy link
Copy Markdown
Contributor Author

ℹ️ Since the VRT changes are all unrelated (will be addressed in #9916) I'm adding the skip-vrt label.

@mgadewoll
mgadewoll requested a lite review from Copilot August 14, 2026 12:20
@mgadewoll mgadewoll added the skip-vrt Skips Visual Regression Testing job in CI (clearly state why you're using it in your PR) label Aug 14, 2026
@mgadewoll

Copy link
Copy Markdown
Contributor Author

buildkite test this

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

This PR fixes an EuiSplitButton layout regression where the primary action can incorrectly receive “icon-only” sizing when used with iconType + text and textProps={false} (text rendered as a string node). It updates the split button’s CSS logic to key off the actual icon-only component class rather than DOM child-element heuristics.

Changes:

  • Updates primary action sizing rules to use .euiButtonIcon instead of :has(svg:only-child) / :only-child-based detection.
  • Adds max-inline-size: fit-content to the split button container to better constrain width to its contents.
  • Adds an upcoming changelog entry documenting the bug fix.

Reviewed changes

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

File Description
packages/eui/src/components/button/split_button/split_button.styles.ts Adjusts split button container sizing and switches icon-only detection to the .euiButtonIcon class to prevent width collapsing.
packages/eui/changelogs/upcoming/9917.md Adds a changelog entry for the EuiSplitButton inline-size fix when textProps={false} is used with iconType.

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

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

cc @mgadewoll

@mgadewoll
mgadewoll marked this pull request as ready for review August 14, 2026 12:37
@mgadewoll
mgadewoll requested a review from a team as a code owner August 14, 2026 12:37
@infra-vault-gh-plugin-prod

infra-vault-gh-plugin-prod Bot commented Aug 14, 2026 •

Copy link
Copy Markdown

💚 Build Succeeded

History

cc @mgadewoll

@acstll acstll 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.

🟢 Tested in Storybook locally following the QA guide, working as expected!

@mgadewoll
mgadewoll merged commit 3c7527a into elastic:main Aug 14, 2026
5 checks 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-vrt Skips Visual Regression Testing job in CI (clearly state why you're using it in your PR)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants