Skip to content

fix(multiple): some experimental components not cleaned up completely #23994

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

Merged
merged 1 commit into from
Nov 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/cdk-experimental/menu/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ export class CdkMenu extends CdkMenuGroup implements Menu, AfterContentInit, OnI
}

override ngOnDestroy() {
super.ngOnDestroy();
this._emitClosedEvent();
this._pointerTracker?.destroy();
}
Expand Down
1 change: 1 addition & 0 deletions src/material-experimental/mdc-form-field/form-field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ export class MatFormField
}

ngOnDestroy() {
this._foundation?.destroy();
this._destroyed.next();
this._destroyed.complete();
}
Expand Down
2 changes: 2 additions & 0 deletions src/material-experimental/mdc-list/list-option.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ export class MatListOption extends MatListItemBase implements ListOption, OnInit
}

override ngOnDestroy(): void {
super.ngOnDestroy();

if (this.selected) {
// We have to delay this until the next tick in order
// to avoid changed after checked errors.
Expand Down
1 change: 1 addition & 0 deletions src/material-experimental/mdc-list/selection-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ export class MatSelectionList
}

override ngOnDestroy() {
super.ngOnDestroy();
this._destroyed.next();
this._destroyed.complete();
this._isDestroyed = true;
Expand Down