- This is the content of the child flyout of {title}.
+
+ This is the content of the child flyout of {title}. It
+ automatically inherits the session because it's nested
+ inside the parent.
+
= (props) => {
},
{
title: 'session',
- description: 'inherit',
+ description: (
+ <>
+ inherit (auto)
+ >
+ ),
},
]}
/>
@@ -293,6 +301,7 @@ const NonSessionFlyout: React.FC<{ size: string }> = ({ size }) => {
{isFlyoutVisible && (
= ({ size }) => {
ownFocus={flyoutOwnFocus}
pushAnimation={true}
onClose={flyoutOnClose}
- session="never"
side="left"
>
@@ -311,9 +319,9 @@ const NonSessionFlyout: React.FC<{ size: string }> = ({ size }) => {
- This is the content of a non-session flyout. We assure it will
- never become a managed flyout by setting{' '}
- {'session={never}'}.
+ This is the content of a non-session flyout. It is assured to
+ not be a managed flyout using the{' '}
+ {'session={never}'} behavior.
= ({ size }) => {
listItems={[
{ title: 'Flyout type', description: flyoutType },
{ title: 'Size', description: 'm' },
- { title: 'session', description: 'never' },
+ {
+ title: 'session',
+ description: (
+ <>
+ never (using default)
+ >
+ ),
+ },
]}
/>
@@ -522,6 +537,7 @@ const ExternalRootChildFlyout: React.FC<{ parentId: string }> = ({
{isOpen && (
{
setIsOpenFlyoutA(false)}
>
- This flyout is rendered with the {'session="start"'} prop set which creates a new flyout session and marks this flyout as main.
+ This is Flyout A. This flyout is rendered with the {'session="start"'} prop set which created a new flyout session and marks this flyout as main.
setName(e.target.value)} />
@@ -68,9 +64,9 @@ export default () => {
>
- This flyout is also rendered with the {'session="start"'} prop added which creates a second flyout session and marks this flyout as main in that session.
+ This is Flyout B. This flyout is also rendered with the {'session="start"'} prop added which creates a second flyout session and marks this flyout as main in that session.
- The first flyout still exists but is currently hidden since this one took precedence. You can jump back to it by clicking the Back button above if you'd like.
+ Flyout A exists but is currently hidden since this one took precedence. You can jump back to it by clicking the Back button above if you'd like.
setIsOpenFlyoutBChild((val) => !val)}>
@@ -78,10 +74,15 @@ export default () => {
{isOpenFlyoutBChild && (
- setIsOpenFlyoutBChild(false)}>
+ setIsOpenFlyoutBChild(false)}
+ >
- This is a child flyout of Flyout B. It belongs to the same session as Flyout B because it's rendered inside of it and doesn't have the session prop set.
+ This is a child flyout of Flyout B. It belongs to the same session as Flyout B because it's rendered inside of it (nested in the JSX tree).
If you close Flyout B - main, this flyout will close, too.
@@ -112,10 +113,15 @@ about compatibility issues.
Each time you set `session="start"`, you create a new flyout session and mark
the rendered flyout as [main](#main-flyouts).
+
To create a [child flyout](#child-flyouts) - a flyout that belongs to the same
-session as the main flyout - you can set `session="inherit"` or omit the `session` prop entirely,
-as "inherit" is the default behavior.
-All bindings and configuration will be handled automatically.
+session as the main flyout - either:
+- Render it inside a main flyout's children (nested in the JSX tree), OR
+- Set `session="inherit"` explicitly (required for cross-React-root scenarios)
+
+When a flyout is nested inside a parent flyout and doesn't have an explicit
+`session` prop, it will automatically inherit the session. All bindings and
+configuration will be handled automatically.
### Session title
@@ -134,8 +140,8 @@ field of the `flyoutMenuProps` to set the title of the flyout.
I'm the main flyout
- {/* Render a new child flyout - notice the lack of the `session` prop */}
```
-To prevent a flyout from being a part of the session management system, you
-can set `session="never"` which will render it as a regular unmanaged flyout.
+To prevent a flyout from being a part of the session management system:
+- Set `session="never"` explicitly, OR
+- Don't nest it inside any parent flyout (non-nested flyouts default to standard behavior)
+
+To force a nested flyout to remain a standard flyout even when inside a parent,
+explicitly set `session="never"`. This will render it as a regular unmanaged flyout.
```tsx
<>
@@ -186,9 +196,11 @@ of an alert.
### Child flyouts
-Child flyouts are directly related to a main flyout in their session.
-They're created by rendering a `EuiFlyout` **without the session prop** inside
-a [main flyout](#main-flyouts) - a flyout with `session="start"` prop set.
+Child flyouts are directly related to a main flyout in their session. They're
+created by rendering an `EuiFlyout` inside a main flyout's children (nested in
+the JSX tree), which causes it to automatically inherit the session. Alternatively,
+you can explicitly set `session="inherit"` when rendering outside the parent's
+JSX tree while an active [main flyout](#main-flyouts) (with `session="start"`) exists.
They're meant to display secondary level information like the alert visualization.