You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[EuiFlyout] When using session flyouts, ref is null #9313
See elastic/kibana#246719. The issue is that the ref is not passed to the underlying EuiManagedFlyout (and ultimately EuiFlyoutComponent) when the session prop is used (e.g. session="start" or session="inherit").
The EuiFlyout component delegates to EuiFlyoutMain or EuiFlyoutChild when a session is active. Neither of these components accept or forward a ref. Furthermore, EuiManagedFlyout, which they both render, creates its own internal ref for useResizeObserver and does not accept an external ref.
Impact and severity
It blocks the "Unified Doc Viewer" opt-in in Kibana because it makes the flyout content not keyboard accessible.
Environment and versions
EUI version: 111.1.0
React version: -
Kibana version (if applicable): -
Browser: -
Operating System: -
Minimum reproducible sandbox
To Reproduce
Steps to reproduce the behavior:
Create a component that renders <EuiFlyout session="start" ref={myRef}>.
Observe that myRef.current remains null or undefined even after the flyout is mounted.
Compare with <EuiFlyout ref={myRef}> (without session), where myRef.current is correctly populated.
Expected behavior
The ref passed to EuiFlyout should be forwarded to the underlying DOM element regardless of whether the session prop is used or not.
Screenshots (Optional)
Additional context (Optional)
The fix requires:
Updating EuiManagedFlyout to use forwardRef.
Merging the internal flyoutRef (used for resize observer) with the forwarded ref in EuiManagedFlyout.
Updating EuiFlyoutMain and EuiFlyoutChild to use forwardRef and pass the ref to EuiManagedFlyout.
Updating EuiFlyout to pass the ref to EuiFlyoutMain and EuiFlyoutChild.
Activity
[-][EuiFlyout] Pass ref to component[/-][+][EuiFlyout] When using session ref is null[/+][-][EuiFlyout] When using session ref is null[/-][+][EuiFlyout] When using session flyouts, ref is null[/+]