Skip to content

[EuiFlyout] Expose refs for EuiFlyoutHeader, EuiFlyoutFooter, and flyout outer scroll container #10087

Description

@tsullivan

Requestor - @tsullivan

Problem Statement

Currently, EuiFlyoutHeader and EuiFlyoutFooter are plain FunctionComponents with no forwardRef and no named ref prop. This means there is no way to get the DOM node for the header or footer without querying the DOM (e.g., using .closest('.euiFlyoutHeader')).

Additionally, the outer scroll container (.euiFlyout__content), which receives overflow-y: auto via &:has(.euiFlyoutBody), has no exposed handle. Because of this, when trying to determine if an outer container can take a scroll event, we have to walk up the ancestor tree reading getComputedStyle(el).overflowY until we hit role="dialog".

Proposed Solution

  1. Wrap EuiFlyoutHeader and EuiFlyoutFooter in forwardRef (or expose a named ref prop) to allow consumers to get direct references to their underlying DOM elements.
  2. Expose a handle or ref for the outer scroll container (.euiFlyout__content) in EuiFlyout so consumers can interact with it without manually walking the ancestor tree.

Use Case

In Kibana, we have implemented a collapsible flyout header behavior. When scrolling the flyout body, the header collapses. To ensure the scroll experience is smooth when hovering over the non-scrollable header, we forward wheel events from the header to the flyout body.

However, because we cannot get a direct reference to the header DOM element or the flyout's outer scroll container, we've had to implement some workarounds that rely on DOM querying and walking the ancestor tree.

Value / Impact - Performance, developer ease-of-use

Urgency - low

Do alternatives or workarounds exist?

DOM querying and walking the ancestor tree

Related code or customizations

See https://github.com/elastic/kibana/pull/290716/changes#diff-3c81071b0ce1428b319b32c5c5620dbce53b882c2458ea2552147f6e621a7c94

Additional context (Optional)

Note that EuiFlyoutBody already sets a precedent by exposing a scrollContainerRef.

Designs or Specs (Optional)

Activity

  1. self-assigned this
    on Sep 25, 2026
  2. vianmangal commented on Sep 30, 2026

    @vianmangal
    Contributor

    I’d be happy to implement this, following the EuiFlyoutBody ref precedent in #9373 . Are you already working on it, or would you welcome an external PR? @tsullivan

  3. removed their assignment
    on Sep 30, 2026
  4. tsullivan commented on Sep 30, 2026

    @tsullivan
    MemberAuthor

    Hi @vianmangal - be my guest! You contribution is welcome.

  5. vianmangal commented on Sep 30, 2026

    @vianmangal
    Contributor

    @tsullivan #10105
    check it out

  6. added
    help wanted
    on Oct 1, 2026
  7. deleted a comment from github-actions on Oct 1, 2026
  8. tsullivan commented on Oct 1, 2026

    @tsullivan
    MemberAuthor

    Closed via #10105

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wanted

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions