Skip to content

[Flyout] set min-inline-size for container-bound flyouts - #9787

Merged
tsullivan merged 6 commits into
elastic:mainfrom
tsullivan:flyouts/fix-size-s-layout-issues
Jul 10, 2026
Merged

tsullivan merged 6 commits into
elastic:mainfrom
tsullivan:flyouts/fix-size-s-layout-issues

Conversation

@tsullivan

@tsullivan tsullivan commented Jul 6, 2026 •

Copy link
Copy Markdown
Member

Needed for elastic/kibana#267417

Summary

  • What: Container-scoped flyouts now enforce a minimum width for named sizes s and m, preventing content from being cropped at narrow container widths.
  • Why: Fixes [Flyouts] Fix s size flyout layout issues kibana#267417 — after flyouts were scoped to #app-main-scroll by default, size s flyouts could shrink to unusably narrow widths because minInlineSize was overridden to 0.
  • How: Replaced the blanket minInlineSize: 0 with per-size pixel minimums derived from theme breakpoints (breakpoint.m * 0.42 for s, breakpoint.m * 0.5 for m), capped at 90% of the container width. fill and custom sizes retain minInlineSize: 0.

API Changes

No public API changes. This is an internal behavioral fix — container flyouts now have a sensible minimum width floor instead of allowing unconstrained shrinking.

component / parent prop / child change description
— — — No API changes

Screenshots

Before After
image image

What if the flyout is resizable?

This fix applies to the flyout's initial named size (s, m). When a flyout is resizable, the resize hook replaces the named size with a percentage string (e.g. "15.5%"), which doesn't match any key in the min-width map — so the floor drops out during and after a resize drag. This is intentional: EuiFlyoutResizable has its own minWidth prop that separately constrains the resize handle, so the two mechanisms don't conflict.

Impact Assessment

  • [ ] 🔴 Breaking changes — N/A
  • 💅 Visual changes — Container-scoped s and m flyouts will no longer shrink below ~323px / ~384px respectively. This matches the intended design and should only improve currently-broken layouts.
  • [ ] 🧪 Test impact — N/A (no HTML structure or class name changes)
  • [ ] 🔧 Hard to integrate — N/A

Impact level: 🟢 Low

Release Readiness

  • [ ] Documentation: {link to docs page(s)} — No doc changes needed
  • [ ] Figma: {link to Figma} — No design changes needed
  • [ ] Migration guide: — No migration needed
  • [ ] Adoption plan: — Fix is automatic for all container flyouts

QA instructions for reviewer

  • Open the container flyout demo in Storybook with mainSize: s and mainResizable: false.
  • Confirm the flyout does not shrink below ~323px at narrow viewport widths.
  • Resize the browser to confirm the flyout grows with the container once 25% of the container exceeds 323px.
  • Switch to mainSize: m and confirm it does not shrink below ~384px.
  • Switch to mainSize: fill and confirm it still behaves as before (takes 90% of container, no minimum floor).
  • Open the child flyout and confirm it also respects the min-width.

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
  • QA: Tested in CodeSandbox and Kibana
  • [ ] QA: Tested docs changes — No docs changes
  • Tests: Added/updated Jest
  • Changelog: Added changelog entry
  • Breaking changes: N/A

@elastic-vault-github-plugin-prod

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

euisuperdatepicker (2 differences)

StoryBeforeAfterDiff
custom time zone display desktop
quick select only desktop

euipopover (1 difference)

StoryBeforeAfterDiff
playground desktop

euidatagrid (1 difference)

StoryBeforeAfterDiff
compact desktop

@tsullivan
tsullivan force-pushed the flyouts/fix-size-s-layout-issues branch from 08e3318 to 0dcc56d Compare July 6, 2026 23:44
@elastic-vault-github-plugin-prod

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

euisuperdatepicker (2 differences)

StoryBeforeAfterDiff
custom time zone display desktop
quick select only desktop

euipopover (1 difference)

StoryBeforeAfterDiff
playground desktop

@tsullivan
tsullivan marked this pull request as ready for review July 7, 2026 17:03
@tsullivan
tsullivan requested a review from a team as a code owner July 7, 2026 17:03
Copilot AI review requested due to automatic review settings July 7, 2026 17:03

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 adjusts container-scoped EuiFlyout sizing so named sizes (s, m) enforce a sensible pixel-based minimum width when rendered inside a container, preventing overly narrow/cropped flyouts after the default container scoping change.

Changes:

  • Add container-specific minInlineSize floors for flyout sizes s and m, derived from theme breakpoints and capped at 90% of the container width.
  • Update Storybook flyout manager demo defaults for mainMinWidth/childMinWidth.
  • Add Jest coverage for container min-inline-size behavior.

Reviewed changes

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

File Description
packages/eui/src/components/flyout/manager/flyout_containers.stories.tsx Updates Storybook args to avoid forcing a min width via the resizable props by default.
packages/eui/src/components/flyout/flyout.component.tsx Implements per-size container min-width floors (for s/m) via minInlineSize when containerRect is present.
packages/eui/src/components/flyout/flyout_container.test.tsx Adds tests verifying container minInlineSize behavior and capping logic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@elastic-vault-github-plugin-prod

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

euisuperdatepicker (2 differences)

StoryBeforeAfterDiff
custom time zone display desktop
quick select only desktop

@elastic-vault-github-plugin-prod

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

euisuperdatepicker (2 differences)

StoryBeforeAfterDiff
custom time zone display desktop
quick select only desktop

@weronikaolejniczak
weronikaolejniczak self-requested a review July 8, 2026 10:18
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

@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 🟢 Tested prod vs PR preview, issue looks fixed 👌🏻

@tsullivan
tsullivan merged commit 81f21c7 into elastic:main Jul 10, 2026
1 check passed
@tsullivan
tsullivan deleted the flyouts/fix-size-s-layout-issues branch July 10, 2026 18:21
mgadewoll added a commit to elastic/kibana that referenced this pull request Jul 17, 2026
## Dependency updates

`@elastic/eui` - v116.5.0 ⏩ v117.0.0

## Changes

- removes temporary custom styles in
`src/core/packages/notifications/browser-internal/src/toasts/global_toast_list.tsx`
(added previously in #273985)
- removes custom icon usages passed via `children` on `EuiCallOut` to
prevent duplication (callouts now have internal default icons per type)
- updates tests and snapshots due to `EuiCallOut` changes

## Package updates

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

- Added `EuiIllustration` for rendering SVG illustrations (e.g. from
`@elastic/eui-illustrations`) that respond to the active EUI color mode
([#9779](elastic/eui#9779))
- Added `compressed` prop to `EuiSearchBar` to enable compact display
mode for the search box and filter buttons
([#9743](elastic/eui#9743))
- Added `addToChat` glyph to `EuiIcon`
([#9768](elastic/eui#9768))
- Updated `EuiCallOut`:
([#9642](elastic/eui#9642))
    - Updated component styles
- Added `text` prop on `EuiCallOut` which renders the main, inline
callout description text - use this instead of `children` where possible
- Added `actionProps` prop on `EuiCallOut` which renders primary and
secondary action buttons
- Added `showErrorTooltip` (defaulting to `true`) to `EuiSearchBar` to
allow consumers to opt-out of the built-in parse-error tooltip
([#9773](elastic/eui#9773))

**Bug fixes**

- Fixed `EuiToast` cutting off absolute positioned content by removing
`overflow: hidden`. ([#9791](elastic/eui#9791))
- Fixed `EuiFlyout` container-scoped flyouts shrinking below usable
widths for named sizes `s` and `m` by applying minimum width floors
derived from theme breakpoints
([#9787](elastic/eui#9787))
- Fixed `EuiSelectable` with group labels rendering options with stale
heights ([#9770](elastic/eui#9770))

**Breaking changes**

- Removed the `accent` variant for `color` on `EuiCallOut`
([#9642](elastic/eui#9642))
patrykkopycinski pushed a commit to patrykkopycinski/kibana that referenced this pull request Aug 5, 2026
## Dependency updates

`@elastic/eui` - v116.5.0 ⏩ v117.0.0

## Changes

- removes temporary custom styles in
`src/core/packages/notifications/browser-internal/src/toasts/global_toast_list.tsx`
(added previously in elastic#273985)
- removes custom icon usages passed via `children` on `EuiCallOut` to
prevent duplication (callouts now have internal default icons per type)
- updates tests and snapshots due to `EuiCallOut` changes

## Package updates

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

- Added `EuiIllustration` for rendering SVG illustrations (e.g. from
`@elastic/eui-illustrations`) that respond to the active EUI color mode
([elastic#9779](elastic/eui#9779))
- Added `compressed` prop to `EuiSearchBar` to enable compact display
mode for the search box and filter buttons
([elastic#9743](elastic/eui#9743))
- Added `addToChat` glyph to `EuiIcon`
([elastic#9768](elastic/eui#9768))
- Updated `EuiCallOut`:
([elastic#9642](elastic/eui#9642))
    - Updated component styles
- Added `text` prop on `EuiCallOut` which renders the main, inline
callout description text - use this instead of `children` where possible
- Added `actionProps` prop on `EuiCallOut` which renders primary and
secondary action buttons
- Added `showErrorTooltip` (defaulting to `true`) to `EuiSearchBar` to
allow consumers to opt-out of the built-in parse-error tooltip
([elastic#9773](elastic/eui#9773))

**Bug fixes**

- Fixed `EuiToast` cutting off absolute positioned content by removing
`overflow: hidden`. ([elastic#9791](elastic/eui#9791))
- Fixed `EuiFlyout` container-scoped flyouts shrinking below usable
widths for named sizes `s` and `m` by applying minimum width floors
derived from theme breakpoints
([elastic#9787](elastic/eui#9787))
- Fixed `EuiSelectable` with group labels rendering options with stale
heights ([elastic#9770](elastic/eui#9770))

**Breaking changes**

- Removed the `accent` variant for `color` on `EuiCallOut`
([elastic#9642](elastic/eui#9642))
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.

[Flyouts] Fix s size flyout layout issues

3 participants