We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7301fa0 commit b53b66aCopy full SHA for b53b66a
src/lib/menu/menu-trigger.ts
@@ -501,8 +501,10 @@ export class MatMenuTrigger implements AfterContentInit, OnDestroy {
501
// while the new trigger tries to re-open it. Wait for the animation to finish
502
// before doing so. Also interrupt if the user moves to another item.
503
if (this.menu instanceof MatMenu && this.menu._isAnimating) {
504
+ // We need the `delay(0)` here in order to avoid
505
+ // 'changed after checked' errors in some cases. See #12194.
506
this.menu._animationDone
- .pipe(take(1), takeUntil(this._parentMenu._hovered()))
507
+ .pipe(take(1), delay(0, asapScheduler), takeUntil(this._parentMenu._hovered()))
508
.subscribe(() => this.openMenu());
509
} else {
510
this.openMenu();
0 commit comments