Skip to content

bug(Overlay): ViewContainerRef.createComponent() fails within Overlay #20343

Open
@zehavibarak

Description

Reproduction

https://stackblitz.com/edit/angular-ivy-mcndqk?file=src/app/first-component/first-component.component.ts

2 components. One creates the 2nd using ViewContainerRef.createComponent().
When the 1st is embedded in the app - it works.

Click the button to reproduce.

Expected Behavior

The 2nd component was suppose to show in the overlay.

Actual Behavior

The 2nd component is not part of the DOM.

Environment

  • Angular: 10.0.9
  • CDK/Material: 10.1.3
  • Browser(s): Chrome, any
  • Operating System Windows

Activity

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

Metadata

Assignees

No one assigned

    Labels

    P2The issue is important to a large percentage of users, with a workaroundarea: cdk/portal

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions