Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug(cdk/overlay): attach() and detach are not working in zoneless apps #28456

Open
1 task
javiermarinros opened this issue Jan 19, 2024 · 1 comment
Open
1 task
Labels
area: cdk/overlay P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@javiermarinros
Copy link

javiermarinros commented Jan 19, 2024

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

The Overlay attach() and detach() methods are relying on the ngZone.onStable observable that is never invoked using the new provideZonelessChangeDetection app provider.

The related actual code:

  // Update the position once the zone is stable so that the overlay will be fully rendered
    // before attempting to position it, as the position may depend on the size of the rendered
    // content.
    this._ngZone.onStable.pipe(take(1)).subscribe(() => {
      // The overlay could've been detached before the zone has stabilized.
      if (this.hasAttached()) {
        this.updatePosition();
      }
    });

Expected Behavior

Overlays to attach and position themselves in zoneless aplications

Actual Behavior

Overlay is created but not positioned and not visible

Environment

  • Angular: 17.1
  • CDK/Material: 17.1
@javiermarinros javiermarinros added the needs triage This issue needs to be triaged by the team label Jan 19, 2024
@javiermarinros javiermarinros changed the title bug(cdk/overlay): attach() is not working in zoneless apps bug(cdk/overlay): attach() and detach are not working in zoneless apps Jan 19, 2024
@atscott
Copy link
Contributor

atscott commented Jan 20, 2024

Indeed, this is the case everywhere in the repo that uses NgZone APIs. This particular one has a WIP fix here #28332

@andrewseguin andrewseguin added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent area: cdk/overlay and removed needs triage This issue needs to be triaged by the team labels Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: cdk/overlay P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

No branches or pull requests

3 participants