Skip to content

Commit 58db9db

Browse files
crisbetojelbourn
authored andcommitted
fix(menu): trigger not unsubscribing from panel close stream (#15667)
Fixes the `matMenuTrigger` not unsubscribing from its `_menuCloseSubscription`. Also removes a pretty simple private method that was only being used once. Fixes #14094.
1 parent 623cd06 commit 58db9db

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/material/menu/menu-trigger.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,9 @@ export class MatMenuTrigger implements AfterContentInit, OnDestroy {
201201
this._element.nativeElement.removeEventListener('touchstart', this._handleTouchStart,
202202
passiveEventListenerOptions);
203203

204-
this._cleanUpSubscriptions();
204+
this._menuCloseSubscription.unsubscribe();
205205
this._closingActionsSubscription.unsubscribe();
206+
this._hoverSubscription.unsubscribe();
206207
}
207208

208209
/** Whether the menu is open. */
@@ -477,12 +478,6 @@ export class MatMenuTrigger implements AfterContentInit, OnDestroy {
477478
]);
478479
}
479480

480-
/** Cleans up the active subscriptions. */
481-
private _cleanUpSubscriptions(): void {
482-
this._closingActionsSubscription.unsubscribe();
483-
this._hoverSubscription.unsubscribe();
484-
}
485-
486481
/** Returns a stream that emits whenever an action that should close the menu occurs. */
487482
private _menuClosingActions() {
488483
const backdrop = this._overlayRef!.backdropClick();

0 commit comments

Comments
 (0)