fix(core): use closest element to resolve dynamic host namespace - #70467
Open
lazerg wants to merge 1 commit into
Open
fix(core): use closest element to resolve dynamic host namespace#70467lazerg wants to merge 1 commit into
lazerg wants to merge 1 commit into
Conversation
Nodes that don't render an element, such as containers, keep whichever namespace was active when they were created, so a dynamic component host inside an `@if` block placed after an `<svg>` was created in the SVG namespace. Look up the closest ancestor element instead. Fixes angular#70465
lazerg
force-pushed
the
fix/issue-70465-host-namespace
branch
from
August 29, 2026 08:39
c0e342a to
452db4d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A dynamic component host picks up its namespace from the node the
ViewContainerRefanchors to, but nodes that don't render an element of their own, like the anchor of an@ifblock, keep whichever namespace happened to be active when they were created. An<svg>earlier in the same template leaves that namespace on them, so a<router-outlet>inside a following@ifcreated its routed host in the SVG namespace and the view laid out as 0x0.The namespace is now resolved by walking up to the closest ancestor element, crossing into the parent view where needed.
Fixes #70465