-
Notifications
You must be signed in to change notification settings - Fork 3.4k
dialog: "Ghost Dialogs" created when $mdDialog resolver fails #11460
Description
Bug, enhancement request, or proposal:
Bug
CodePen and steps to reproduce the issue:
Ghost Bug Demo which demonstrates the issue:
Detailed Reproduction Steps:
- In my CodePen open the first Dialog via the "Open This Button"
- Notice If you press close in the upper right hand corner it will close as expected.
- Open it again and click on the "BREAKS" button one or more times.
- Now notice you will have to press the same close button as many times as you pressed BREAKS + 1 in order to close the current dialog.
What is the expected behavior?
When attempting to open a dialog whose resolver object fails to complete, a dialog should either never be created, or treated as cancelled.
What is the current behavior?
A "Ghost Dialog" is created that cannot be seen, butt calling $mdDialog seems to close them. That is why you can press the "BREAKS" button twice and then press close three times before the dialog actually closes. Two "Ghost Dialogs" are created and then cancelled before you can cancel the visible dialog.
What is the use-case or motivation for changing an existing behavior?
In our case we utilize large md-dialogs that have a lot of sub-screens in combination with md-tabs. Some of these screens have smaller modals that require network requests that are processed via the resolver. In most cases these are successful and we would not experience this problem, but if a service goes down, the interface would appear to be broken to a user.
Which versions of AngularJS, Material, OS, and browsers are affected?
- AngularJS: Latest
- AngularJS Material: Latest
- OS: OSX / Linux / Windows
- Browsers: Chrome / Safari / Firefox / IE11
Is there anything else we should know? Stack Traces, Screenshots, etc.
It doesn't seem like there are any DOM nodes that get created for these "Ghost Dialogs". Other than that I haven't had much of a chance to look into this.