Skip to content

bug(cdk/portal): DOM node inserted at the wrong place #34025

Open

Description

@Gouvernathor

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

Instead of being inserted at the location of the portal outlet, the DOM node in the portal is inserted at the end of the component's template.

Reproduction

StackBlitz doesn't work in my browser.

https://codeberg.org/Gouvernathor/ParliamentDiagram-Angular/commit/95ada2ff983f4e22109b50392cfa9e2706aa7f6c

Expected Behavior

The SVG diagram should be inserted at the place where I wrote the ng-template carrying the cdkPortalOutlet directive, which is at the beginning of the component.

Actual Behavior

The SVG diagram is inserted at the end of the component.

Environment

Angular CLI : 22.1.3
Angular : 22.1.1
Node.js : 26.4.0
Package Manager : npm 11.12.0
Operating System : win32 x64

┌───────────────────────────┬───────────────────┬───────────────────┐
│ Package │ Installed Version │ Requested Version │
├───────────────────────────┼───────────────────┼───────────────────┤
│ @angular/build │ 22.1.3 │ ^22.1.3 │
│ @angular/cdk │ 22.1.1 │ ^22.1.1 │
│ @angular/cli │ 22.1.3 │ ^22.1.3 │
│ @angular/common │ 22.1.1 │ ^22.1.1 │
│ @angular/compiler │ 22.1.1 │ ^22.1.1 │
│ @angular/compiler-cli │ 22.1.1 │ ^22.1.1 │
│ @angular/core │ 22.1.1 │ ^22.1.1 │
│ @angular/forms │ 22.1.1 │ ^22.1.1 │
│ @angular/material │ 22.1.1 │ ^22.1.1 │
│ @angular/platform-browser │ 22.1.1 │ ^22.1.1 │
│ @angular/router │ 22.1.1 │ ^22.1.1 │
│ rxjs │ 7.8.2 │ ~7.8.0 │
│ typescript │ 6.0.3 │ ~6.0.3 │
│ vitest │ 4.1.10 │ ^4.0.8 │
└───────────────────────────┴───────────────────┴───────────────────┘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: cdk/portalgemini-triagedLabel noting that an issue has been triaged by geminineeds triageThis issue needs to be triaged by the team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions