angular / components

Component infrastructure and Material Design components for Angular
https://material.angular.io
MIT License
24.33k stars 6.73k forks source link

MatDialog not working properly on pageload on NgUniversal (ssr) #15579

Closed mastermsd closed 4 years ago

mastermsd commented 5 years ago

What is the expected behavior?

MatDialog should behave the same on a ssr application

What is the current behavior?

On SSR, when MatDialog is triggered (this.dialog.open()) on pageload (ngOnInit) two <cdk-overlay-container> is generated in the DOM. When trying to close it (this.dialog.close()) only one instance is responding to it. The other one still remain in the DOM. Which leaves the user with a dialog on the screen which can not been closed.

What are the steps to reproduce?

Run your app on SSR, open MatDialog on ngOnInit.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

"@angular-devkit/build-angular": "^0.10.1",
"@angular/animations": "^7.0.0",
"@angular/cdk": "^7.3.0",
"@angular/cli": "^7.0.0",
"@angular/common": "^7.0.0",
"@angular/compiler": "^7.0.0",
"@angular/compiler-cli": "^7.0.0",
"@angular/core": "^7.0.0",
"@angular/flex-layout": "^7.0.0-beta.19",
"@angular/forms": "^7.0.0",
"@angular/http": "^7.0.0",
"@angular/material": "^7.3.0",
"@angular/platform-browser": "^7.0.0",
"@angular/platform-browser-dynamic": "^7.0.0",
"@angular/platform-server": "^7.0.0",
"@angular/router": "^7.0.0",
"@nguniversal/express-engine": "^7.0.2",
"@nguniversal/module-map-ngfactory-loader": "^7.0.0"

MacOS Mojave (10.14.3) Typescript 3.1.x Node 10.13.0 Yarn 1.10.0

Affects all browsers

Is there anything else we should know?

-

crisbeto commented 5 years ago

We've got a PR to solve this already: https://github.com/angular/material2/pull/11940, although it needs a little bit of love to pass the CI. @jelbourn should we bump the priority on it?

mastermsd commented 5 years ago

@jelbourn can this PR been merged asap please. This is a critical blocker and may not go in to production.

crisbeto commented 4 years ago

Closing since this was fixed a long time ago.

angular-automatic-lock-bot[bot] commented 4 years ago

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.