TanStack Virtual — ResizeObserver Bug

@tanstack/react-virtual@3.13.19 (@latest) — ResizeObserver element hijacking after item deletion

BUG

Broken

Unpatched @tanstack/react-virtual. After deleting an item, expanding a surviving item fails to update the virtualizer.

FIXED

Fixed

Same app with a patch that checks node.isConnected before the elementsCache swap, preventing dead elements from hijacking live observers.

Repro steps: Expand A → Collapse A → Delete A → Expand B.
In the broken version, B's expanded content is invisible to the virtualizer. In the fixed version, it works correctly.