Skip to content

[EuiTreeView]: expanded nodes clipped at 100vh, causing sibling overlap #9395

Closed

Description

@Kiryous

Bug description

When an EuiTreeView node has many children (enough to exceed the viewport height), collapsing and re-expanding it clips the children at 100vh. Sibling nodes that come after the expanded node overlap with / appear interleaved between the children.

Root cause: The expanded state of .euiTreeView__node applies:

max-block-size: 100vh;

Source: tree_view_item.styles.ts — expanded: css(logicalCSS('max-height', '100vh'))

Steps to reproduce

  1. Render an EuiTreeView with a parent node containing 50 children, followed by sibling nodes
  2. All nodes are expanded by default (expandByDefault)
  3. Collapse the parent node
  4. Re-expand the parent node
  5. Scroll down
  6. Bug: sibling nodes ("Sibling after 1", "Sibling after 2") overlap with children around item 20, and are completely missing from the bottom of the list

Minimal reproduction

import React from 'react';
import { EuiTreeView } from '@elastic/eui';

const childItems = Array.from({ length: 50 }, (_, i) => ({
  id: `child-${i}`,
  label: `Child item ${i}`,
}));

const treeItems = [
  { id: 'sibling-before', label: 'Sibling before' },
  {
    id: 'parent-with-children',
    label: 'Parent with many children',
    children: childItems,
  },
  { id: 'sibling-after-1', label: 'Sibling after (1)' },
  { id: 'sibling-after-2', label: 'Sibling after (2)' },
];

export const Repro = () => (
  <div style={{ width: 300, height: 400, overflow: 'auto', border: '1px solid #ccc' }}>
    <EuiTreeView
      items={treeItems}
      showExpansionArrows
      expandByDefault
      aria-label="Tree with large expanded node"
    />
  </div>
);

Screenshots

1. Initial expanded state (correct — children visible, siblings below scroll):

Image

2. After collapsing the parent (correct — siblings visible below):

Image

3. After re-expanding + scrolling to ~30% (BUG — siblings overlap with children):

Image

4. After re-expanding + scrolling to bottom (BUG — siblings completely missing):

Image

Expected behavior

After collapsing and re-expanding the parent, scrolling should show all 50 children followed by the two "Sibling after" nodes — in correct order, fully visible, with no overlap.

Actual behavior

The expanded <li> is clipped at max-block-size: 100vh. Sibling nodes after the expanded parent overlap with children around the clipping boundary (~item 20) and are completely absent from the bottom of the scrollable area.

Workaround

Override the max-block-size on .euiTreeView__node:

.euiTreeView__node {
  max-block-size: none;
}

Environment

  • EUI version: 112.3.0
  • Browser: Chrome (reproducible in all browsers)

Activity

  1. changed the title [-]EuiTreeView: expanded nodes clipped at 100vh, causing sibling overlap[/-] [+][EuiTreeView]: expanded nodes clipped at 100vh, causing sibling overlap[/+] on Feb 17, 2026
  2. added theissue type on Mar 10, 2026
  3. JasonStoltz commented on Mar 10, 2026

    @JasonStoltz
    Contributor

    We discussed this in a Triage session.

    @tkajtoch and @weronikaolejniczak identified this as a likely virtualization issue.

    We assigned this to @weronikaolejniczak for further investigation.

  4. added
    ⚠️ needs validation
    on Mar 10, 2026
  5. removed
    ⚠️ needs validation
    on Mar 16, 2026
  6. weronikaolejniczak commented on Mar 19, 2026

    @weronikaolejniczak
    Contributor

    The fix was already merged but I forgot to use the closing keyword so that it automatically closes 😅

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

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions