Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Flyout width calculations mishandle CSS sizes, clamped baselines, and child minimum widths, causing incorrect width resets, misleading onResize callbacks, and missed overflow handling.
3 open issues
What changed in this PR
Addresses the child-opening scenario in #9683 by resetting an oversized, resizable main flyout to its configured size when the pair would otherwise exceed the available space. Container-resize behavior remains unchanged.
Changes:
- Adds an opening-time width reset and synchronizes it with the flyout manager before paint.
- Tests reset behavior and cases where dragged widths should be preserved.
- Documents the reset and the expanded
onResizecallback behavior.
| File | Description |
|---|---|
packages/website/docs/components/containers/flyout/_flyout_resizable.mdx |
Documents resets and persisted-width implications. |
packages/eui/src/components/flyout/use_flyout_resizable.ts |
Adds child-opening fit checks and width resets. |
packages/eui/src/components/flyout/use_flyout_resizable.test.ts |
Tests resets, callbacks, and width preservation. |
packages/eui/src/components/flyout/manager/README.md |
Explains reset conditions and manager synchronization. |
packages/eui/src/components/flyout/flyout.component.tsx |
Supplies child context and publishes reset widths. |
packages/eui/changelogs/upcoming/10250.md |
Records the behavior change. |
Review effort: Balanced
…n there's room again, the same as a numeric size
…hild can no longer feed each other in a loop
|
|
||
| We strongly recommend setting reasonable numerical `minWidth` and `maxWidth` props based on the flyout content and page content that you _can_ predict. | ||
|
|
||
| In a flyout session, a resizable main flyout and its child flyout stay side by side whenever they can. If the user dragged the main flyout so wide that the child doesn't fit beside it, either when the child opens or when the available space narrows, the main flyout shrinks to the largest width that fits. When the child closes or the space widens again, the main flyout returns to the width the user dragged it to. With a named `size`, that width scales with the available space. A resizable child flyout keeps its shrunk width, so the main flyout gets the space back first. `onResize` is only called when the user resizes the flyout, so a width you save from it is never replaced by a shrunk one. The flyouts still stack when the available space is too narrow, or when the main flyout's `minWidth` leaves no room for the child. |
There was a problem hiding this comment.
Severity: P3 (Low)
The new statement that a resizable child keeps its shrunk width only holds for string/named sizes. Numeric sizes are supported too, but that branch still re-clamps from requestedWidthRef, ignoring isChildFlyout, so a numeric-size child grows back when space becomes available. Qualify this statement (and the equivalent manager README text), or implement the same policy for numeric-size children, so consumers aren't promised main-flyout priority that isn't provided.
Generated by Libra. Specialist: docs-and-changelog. React with 👍 or 👎 to give feedback on this comment.
There was a problem hiding this comment.
No change needed: a managed child flyout cannot have a numeric size. validateManagedFlyoutSize (manager/validation.ts) rejects any child size other than s, m, l or fill, and EuiManagedFlyout throws on that error in every environment (flyout_managed.tsx), so a child never reaches the numeric-size branch of the resize hook. The statement that a resizable child keeps its shrunk width therefore holds for every child the flyout system allows, and adding the child rule to the numeric branch would only add code that cannot run.
💚 Build Succeeded
History
|
💚 Build Succeeded
History
|
Dosant
left a comment
There was a problem hiding this comment.
LGTM! probably worth running kibana integration check if no tests break
Kibana Regression Integration TestStatus: 💚 Kibana CI passed |

Summary
Fixes #9683.
In the flyout system, if a user drags a resizable main flyout wide and then opens a child flyout, or the container narrows, the pair switches to
stackedlayout mode, which hides the main flyout behind the child. With this change, the main flyout shrinks to the largest width that fits beside the child, and the pair stays side-by-side. Once there is room again, such as when the child closes, the main flyout returns to the width the user dragged it to.The resize clamp already limits a resizable main flyout and its child to 90% of the container in
side-by-sidemode, but layout mode decided from the main flyout's wider width first, and the clamp is off instackedmode. Layout mode now decides from the width the clamp will apply, using the child's measured width. To know which main flyouts are clamped, the manager now stores whether each flyout is resizable. For a main flyout, the clamp starts from the user's dragged width for named sizes too (before, only numeric sizes did), so a named-size main flyout no longer keeps the clamped width. A child flyout keeps its clamped width, so a dragged main and a dragged child can't keep resizing each other.onResizeis still only called for user resizes, so a saved width is never replaced by a clamped one.API Changes
getFlyoutManagerStore()setFlyoutResizableEuiManagedFlyoutkeeps it in sync, so consumers don't need to call itScreenshots
Main flyout dragged to 1440px on a 1920px viewport, then "Open child panel" clicked:
Impact Assessment
Note: Most PRs should be tested in Kibana to help gauge their Impact before merging.
Impact level: 🟢 Low
Release Readiness
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
FlyoutChildDemo) withmainFlyoutResizableenabled, in a wide viewport (e.g. 1920px).mainFlyoutResizabledisabled, confirm that opening the child behaves as before.Checklist before marking Ready for Review
Breaking changes: Addedbreaking changelabel (if applicable)Reviewer checklist