Skip to content

MatDialog unresponsive when opened from ErrorHandler with error from async method #16717

@aleksandar-kandzhichki

Description

@aleksandar-kandzhichki

Reproduction

StackBlitz example: https://stackblitz.com/edit/components-issue-h6h2vv

Steps to reproduce:

  1. Provide global error handler for angular
  2. Throw any Error within async function

Expected Behavior

The lifecycle of the dialog should be triggered and the dialog should display the information

Actual Behavior

The only thing from the dialog class called is the constructor, everything else is not called and the dialog cannot be closed

Environment

  • Angular: 7.2.2
  • CDK/Material: 7.2.2
  • Browser(s): Google Chrome, StackBlitz
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows

Comment

When I tried it out on my environment, I found out that any resize event (maybe other events too) trigger the lifecycle of the component, it updates and works fine.
On StackBlitz though the events are not triggered in any case, it just renders the app totally unresponsive

So my current solution to this is - dispatching resize event right after opening the dialog, which makes it work fine, but I have no idea why is it failing to trigger the onInit etc. by itself.

Also no .onOpen() or .onOpened() subscriptions emit any data before resize event

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