fix(react-virtual): make directDomUpdates a no-op without containerRef by piecyk · Pull Request #1201 · TanStack/virtual · GitHub
Skip to content

fix(react-virtual): make directDomUpdates a no-op without containerRef - #1201

Merged
piecyk merged 1 commit into
TanStack:mainfrom
piecyk:fix/direct-dom-updates-no-container
Jun 15, 2026
Merged

piecyk merged 1 commit into
TanStack:mainfrom
piecyk:fix/direct-dom-updates-no-container

Conversation

@piecyk

@piecyk piecyk commented Jun 15, 2026 •

Copy link
Copy Markdown
Collaborator

🎯 Changes

Make directDomUpdates a no-op for direct DOM writes when containerRef is omitted. Previously the virtualizer still wrote item positions while never sizing the container (a broken half-state). Now omitting containerRef skips all direct writes while still skipping re-renders, letting consumers own the DOM updates themselves (e.g. in onChange).

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • Bug Fixes

    • Fixed direct DOM update behavior when a container reference is not provided; now properly skips all DOM writes instead of partial updates.
  • Documentation

    • Updated documentation clarifying direct DOM update behavior without a container reference.
  • Tests

    • Added test coverage for direct DOM updates without container reference.

@coderabbitai

coderabbitai Bot commented Jun 15, 2026 •

Copy link
Copy Markdown

@nx-cloud

nx-cloud Bot commented Jun 15, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 4dd2834

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 43s View ↗
nx run-many --target=build --exclude=examples/** ✅ Succeeded 16s View ↗

☁️ Nx Cloud last updated this comment at 2026-06-15 18:57:47 UTC

@pkg-pr-new

pkg-pr-new Bot commented Jun 15, 2026

Copy link
Copy Markdown

@piecyk
piecyk merged commit 2ba5eb6 into TanStack:main Jun 15, 2026
10 checks passed
@github-actions github-actions Bot mentioned this pull request Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant