Skip to content

fix(runtime): create new element for new child when keyed tag changes - #6885

Merged
johnjenkins merged 2 commits into
mainfrom
fix-vdom-patch-use-new-itm-idx
Sep 11, 2026
Merged

fix(runtime): create new element for new child when keyed tag changes#6885
johnjenkins merged 2 commits into
mainfrom
fix-vdom-patch-use-new-itm-idx

Conversation

@johnjenkins

@johnjenkins johnjenkins commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

What is the current behavior?

GitHub Issue Number: #6879

updateChildren passes the wrong child index to createElm when a keyed child's tag changes between renders.

What is the new behavior?

Fixes #6879

Changes idxInOld > newStartIdx in that call so the new element is created for the child being processed. The stale old element is removed by the existing removeVnodes cleanup.

Documentation

Does this introduce a breaking change?

  • Yes
  • No

Testing

Other information

@johnjenkins
johnjenkins requested a review from a team as a code owner September 11, 2026 23:30
@johnjenkins
johnjenkins merged commit 3743c44 into main Sep 11, 2026
31 checks passed
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.

bug: keyed child diff creates the wrong element when a key changes tag

1 participant