Skip to content

fix: stale node dimensions after updateNodeInternals call - #5979

Open
jundejz wants to merge 3 commits into
xyflow:renovatefrom
jundejz:renovate-issue-3910
Open

jundejz wants to merge 3 commits into
xyflow:renovatefrom
jundejz:renovate-issue-3910

Conversation

@jundejz

@jundejz jundejz commented Aug 25, 2026

Copy link
Copy Markdown

Summary

Measuring the height and width of a node right after a change in height or width resulted in a stale measurement since there's a non-deterministic delay in rAF. We makes useUpdateNodeInternals async to ensure a fixed delay. In React we wrap the rAF in a Promise and in Svelte we use tick().then(...)

Changes Made

  • For React useUpdateNodeInternals wrap the rAF in a Promise
  • For Svelte we use tick().then(...)
  • For both we add a try...catch
  • Adds E2E tests

Testing

  • ✅ All existing tests pass
  • ✅ New UpdateNodeInternalsNode test fixture component and updateNodeInternals test added

N.B. I'm unsure about the Vue change since I've been working on my fork on main - happy for you to do any changes in this regard

Closes #3910

@changeset-bot

changeset-bot Bot commented Aug 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a797639

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@jundejz
jundejz marked this pull request as ready for review August 25, 2026 16:53
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