elastic / elastic/eui

[EuiSelectable] `height=full` inside flyout with EuiFlyoutBody

Open
#8,691 3 comments 0 reactions 0 assignees View on GitHub
low hanging fruit stale-issue
Dominant language
TypeScript
Stars
6.4k
Forks
911
Avg merge
2d 11h
Merged PRs (30d)
65

Description

It's possible to render `EuiSelectable` inside `EuiFlyout`. There's [this example in the docs](https://eui.elastic.co/docs/components/forms/selection/selectable/#flexbox) that shows it.

In the example `EuiFlyoutHeader` and `EuiFlyoutFooter` are used, but not `EuiFlyoutBody`, because it will make the `list` element have a height of `0`. The combination of `height="full"` in `EuiSelectable` (the list being virtualized) with the inner container in the flyout body not having `display: flex`, breaks the layout.

We should check whether other virtualized content has the same issue while being rendered inside `EuiFlyoutBody`, and determine the scope of a possible fix, whether it'd be in the Selectable or the Flyout, or any other component. For example, a possible fix could be adding a `fullHeight` prop to `EuiFlyoutBody`…

### Impact and severity

Low. Easy workaround available and a bit edge-casey.

### Minimum reproducible sandbox

The codesandbox below has a `EuiSelectable` inside `EuiFlyout`, because the `list` is rendered inside `EuiFlyoutBody`, its height becomes 0.

https://codesandbox.io/p/sandbox/romantic-microservice-s7pg3c

A suggested workaround could be adding some custom styles to `EuiFlyoutBody`:

```tsx

{list}

```

### Expected behavior

To be able to wrap `EuiSelectable`'s `list` inside `EuiFlyoutBody`.

### Screenshots

![Image](https://github.com/user-attachments/assets/c0aa481c-9e13-4339-b90a-853f7488769a)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.