-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Closed
Labels
P2The issue is important to a large percentage of users, with a workaroundThe issue is important to a large percentage of users, with a workaroundarea: material/dialog
Description
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
When open and then close a mat-dialog, the elements linked to the mat-dialog and its contents remain in the DOM in memory in "Detached elements" state.
Each time a mat-dialog is opened/closed the phenomenon repeats itself, and the number of "detached elements" only increases.
Reproduction
Steps to reproduce:
- Create new angular project
- Create dialog component (like this: https://material.angular.io/components/dialog/overview)
- put a element in the dialog-component.html
- compile
- open chrome dev tools -> memory
- take a first snapshot with memory dev tools
- open and close the dialog multiple times, use the garbage collector afterwards
- take a second snapshot with memory dev tools
- compare the two snapshots
- look at "detached"
=> several count (for each open/close mat-dialog) of "Detached <mat-dialog-container" (and all children) stay in the DOM
Expected Behavior
After mat-dialog closed, we expect not to see "Detached " in memory (to prevent from memory leak)
Actual Behavior
Environment
- Angular:
- CDK/Material:
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Ubuntu
Metadata
Metadata
Assignees
Labels
P2The issue is important to a large percentage of users, with a workaroundThe issue is important to a large percentage of users, with a workaroundarea: material/dialog
