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

[Dialog] Open doesn't open a new dialog #8248

Closed
bracco23 opened this issue Nov 6, 2017 · 3 comments
Closed

[Dialog] Open doesn't open a new dialog #8248

bracco23 opened this issue Nov 6, 2017 · 3 comments

Comments

@bracco23
Copy link

bracco23 commented Nov 6, 2017

Bug, feature request, or proposal:

Undocumented behaviour or bug.

What is the expected behavior?

According to the documentation, if I use Matdialog.open a new dialog is opened, without any mention of preconditions

What is the current behavior?

As can be easily seen in dialog.ts, if a dialog is already opening, no new dialog is created and the animating one is returned. Why?

What is the use-case or motivation for changing an existing behavior?

In my case, I'm creating dialogs to show loading spinners in an HttpInterceptor. The component in the dialog requests some data at the opening, so the sequence of operation is:

  • dialog_1, with the actual component, is opened
  • the component is loaded and fires an http request
  • the interceptor tries to open a dialog for the spinner (fails, gets back dialog_1 reference)
  • the interceptor gets the response and close the dialog (which should be the newly opened spinner dialog, but closes the main dialog)

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

angular 5, material 2.0.0-beta.10, Windows 10 1703, typescript 2.4.2

Is there anything else we should know?

@crisbeto
Copy link
Member

crisbeto commented Nov 6, 2017

This was a limitation that was put in place to avoid some focus management issues. It will be removed in the next release. See #8051.

@crisbeto crisbeto closed this as completed Nov 6, 2017
@Howard-Song
Copy link

same problem,I use

 this.editDialog.afterClosed().subscribe(data => {
    if (data) {
      this.query();
    }
 });

to do next http request for now.

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants