Skip to content

Dialog triggers change detection on keyboard events #10143

Closed
@OmriSoudry

Description

@OmriSoudry

Bug, feature request, or proposal:

Opening a dialog using this.dialog.open(...) [where dialog is MatDialog from the constructor] causes my app to run a change detection for every key press - even after closing the dialog. After opening 10 dialogs, each key press triggers 10 change detections. The event triggers are only removed when I refresh the page and reload the app.

This happens even with a dialog that only has a mat-dialog-close button.

What is the expected behavior?

When a dialog is closed (no matter the reason), all listeners should be removed.

What is the current behavior?

The listeners remains, triggering a change detection event after every key press. Trying to hold down a key after a while causes hundreds of change detections every second, and low-end devices freeze.

What are the steps to reproduce?

I Couldn't reproduce it on StackBlitz. I'm using Angular v2.0.0.beta-12.

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions