Skip to content

fix(core): ensure proper cleanup of transplanted views - #70929

Draft
JeanMeche wants to merge 1 commit into
angular:mainfrom
JeanMeche:fix-transplanted-views-cleanup
Draft

JeanMeche wants to merge 1 commit into
angular:mainfrom
JeanMeche:fix-transplanted-views-cleanup

Conversation

@JeanMeche

@JeanMeche JeanMeche commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

This fixes two issues with transplanted views during cleanup:

  1. Prevents double-detachment bugs where detachView performs redundant DOM manipulation and query detachments on a view that is already destroyed.
  2. Ensures the LContainerFlags.HasTransplantedViews flag is correctly cleared when the last transplanted view is detached, preventing unnecessary change detection traversals.

fixes #70923

@angular-robot angular-robot Bot added the area: core Issues related to the framework runtime label Sep 24, 2026
@ngbot ngbot Bot added this to the Backlog milestone Sep 24, 2026
@JeanMeche
JeanMeche force-pushed the fix-transplanted-views-cleanup branch 2 times, most recently from cd34e80 to 2fc0fbe Compare September 24, 2026 22:48
This fixes two issues:
1. Prevents double-detachment bugs where detachView performs redundant DOM manipulation and query detachments on a view that is already destroyed.
2. Ensures the LContainerFlags.HasTransplantedViews flag is cleared when the last transplanted view is detached, preventing unnecessary change detection traversals.
@JeanMeche
JeanMeche force-pushed the fix-transplanted-views-cleanup branch from 2fc0fbe to d83010b Compare September 24, 2026 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: core Issues related to the framework runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Destroying a transplanted view twice removes another live view from change detection

1 participant