Repository navigation
[EuiSplitButton] Fix inline-size behavior - #9917
Conversation
- :only-child doesn't account for string only text
44 visual difference(s) found - expand to review, then click Approve visual changes to update baselineseuiicon (2 differences)
euicombobox (9 differences)
euiform (1 difference)
euiinlineedittext (2 differences)
euiflexgrid (1 difference)
euiflyout (14 differences)
euiheader (4 differences)
euicollapsiblenav (4 differences)
euicontextmenu (1 difference)
euikeypadmenu (1 difference)
euidatagrid (4 differences)
euitable (1 difference)
|
|
ℹ️ Since the VRT changes are all unrelated (will be addressed in #9916) I'm adding the |
|
buildkite test this |
There was a problem hiding this comment.
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
.euiButtonIconinstead of:has(svg:only-child)/:only-child-based detection. - Adds
max-inline-size: fit-contentto 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.
💚 Build Succeeded
History
cc @mgadewoll |
💚 Build Succeeded
History
cc @mgadewoll |
acstll
left a comment
There was a problem hiding this comment.
🟢 Tested in Storybook locally following the QA guide, working as expected!
## 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]>
## 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]>
























































































































Summary
EuiSplitButtonwidth collapsing for icon + text usage.:only-childselector with a direct class selector. The issue is that:only-childcounts nodes, but iftextProps={false}is set on buttons, the innerEuiButtonDisplayContentskips the render node and renders text as string. That would result in icon-only inline-size being applied and the button looking collapsed.max-inline-sizeto the group element to prevent unwanted stretchingAPI Changes
⚪ No API changes
Screenshots
Impact Assessment
Note: Most PRs should be tested in Kibana to help gauge their Impact before merging.
Impact level: 🟢 None
🧪 The changes have been run in Kibana CI (🟢 build)
Release Readiness
QA instructions for reviewer
💻 Storybook
<EuiSplitButton.ActionPrimary iconType="faceHappy" textProps={false}>:has(svg:only-child)style is not appliedChecklist before marking Ready for Review
breaking changelabel (if applicable)Reviewer checklist