Skip to content

bug(CdkPortalOutlet): Component can be rendered outside CdkPortalOutlet #26187

Open
@SebastianPodgajny

Description

@SebastianPodgajny

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

If you have ComponentPortal with provided ViewContainerRef NgForOf can rerender component outside CdkPortalOutlet.
Looks like this code is executed only once and after NgForOf dom manipulations there is nothing that can move ComponentPortalExample to expected position

Reproduction

Demo

Steps to reproduce:

  1. Wait until component outlet will render component
  2. Drag Item 1 down
  3. Drag Item 1 up
  4. ComponentPortalExample is rendered inside item list instead of inside component outlet
    instead

Expected Behavior

ComponentPortalExample should stay inside CdkPortalOutlet

Actual Behavior

ComponentPortalExample is rendered inside item list instead of inside CdkPortalOutlet

Environment

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: cdk/portal

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions