Skip to content

fix(core): use closest element to resolve dynamic host namespace - #70467

Open
lazerg wants to merge 1 commit into
angular:mainfrom
lazerg:fix/issue-70465-host-namespace
Open

fix(core): use closest element to resolve dynamic host namespace#70467
lazerg wants to merge 1 commit into
angular:mainfrom
lazerg:fix/issue-70465-host-namespace

Conversation

@lazerg

@lazerg lazerg commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

A dynamic component host picks up its namespace from the node the ViewContainerRef anchors to, but nodes that don't render an element of their own, like the anchor of an @if block, 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 @if created 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

@pullapprove
pullapprove Bot requested a review from atscott August 29, 2026 08:29
@angular-robot angular-robot Bot added the area: core Issues related to the framework runtime label Aug 29, 2026
@ngbot ngbot Bot added this to the Backlog milestone Aug 29, 2026
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
lazerg force-pushed the fix/issue-70465-host-namespace branch from c0e342a to 452db4d Compare August 29, 2026 08:39
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.

Routed component host created in SVG namespace after an <svg> sibling (22.1.4)

1 participant