Skip to content

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

Closed

Description

@bracco23

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?

Activity

  1. crisbeto commented on Nov 6, 2017

    @crisbeto
    Member

    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.

  2. Howard-Song commented on Nov 16, 2017

    @Howard-Song

    same problem,I use

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

    to do next http request for now.

  3. angular-automatic-lock-bot commented on Sep 7, 2019

    @angular-automatic-lock-bot

    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.

  4. locked and limited conversation to collaborators on Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions