8000 bug(DomPortalOutlet): hasAttached returns false after attachComponentPortal · Issue #22370 · angular/components · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
bug(DomPortalOutlet): hasAttached returns false after attachComponentPortal  #22370
Closed
@fcostarodrigo

Description

@fcostarodrigo

Reproduction

Use StackBlitz to reproduce your issue:
https://stackblitz.com/edit/angular-ivy-b4babe?file=src/app/app.component.ts

Steps to reproduce:

  1. Attach a component portal.
  2. Call has attached method.

Expected Behavior

What behavior were you expecting to see?
Return true.

Actual Behavior

What behavior did you actually see?
Return false.

Environment

  • Angular: 11.2.7
  • CDK/Material: 11.2.6
  • Browser(s): Firefox
  • Operating System (e.g. Windows, macOS, Ubuntu): macOS
Notes

The attach works fine, the issue happens because calling attachComponentPortal directly won't set _attachedPortal and hasAttached won't work as expected. A solution would be the attachs specific methods set _attachedPortal or make the attaches methods private if they are not meant to be called.

Metadata

Metadata

Assignees

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

    0