Skip to content
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
2 changes: 1 addition & 1 deletion goldens/material/menu/index.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export class MatMenu implements AfterContentInit, MatMenuPanel<MatMenuItem>, OnI
_handleKeydown(event: KeyboardEvent): void;
hasBackdrop?: boolean;
_hovered(): Observable<MatMenuItem>;
_isAnimating: boolean;
_isAnimating: i0.WritableSignal<boolean>;
// @deprecated
items: QueryList<MatMenuItem>;
lazyContent: MatMenuContent;
Expand Down
2 changes: 1 addition & 1 deletion src/material/menu/menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[class]="_classList"
[class.mat-menu-panel-animations-disabled]="_animationsDisabled"
[class.mat-menu-panel-exit-animation]="_panelAnimationState === 'void'"
[class.mat-menu-panel-animating]="_isAnimating"
[class.mat-menu-panel-animating]="_isAnimating()"
(click)="closed.emit('click')"
tabindex="-1"
role="menu"
Expand Down
7 changes: 4 additions & 3 deletions src/material/menu/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
AfterRenderRef,
inject,
Injector,
signal,
} from '@angular/core';
import {_IdGenerator, FocusKeyManager, FocusOrigin} from '@angular/cdk/a11y';
import {Direction} from '@angular/cdk/bidi';
Expand Down Expand Up @@ -137,7 +138,7 @@ export class MatMenu implements AfterContentInit, MatMenuPanel<MatMenuItem>, OnI
readonly _animationDone = new Subject<'void' | 'enter'>();

/** Whether the menu is animating. */
_isAnimating = false;
_isAnimating = signal(false);

/** Parent menu of the current menu panel. */
parentMenu: MatMenuPanel | undefined;
Expand Down Expand Up @@ -461,13 +462,13 @@ export class MatMenu implements AfterContentInit, MatMenuPanel<MatMenuItem>, OnI
this._exitFallbackTimeout = undefined;
}
this._animationDone.next(isExit ? 'void' : 'enter');
this._isAnimating = false;
this._isAnimating.set(false);
}
}

protected _onAnimationStart(state: string) {
if (state === ENTER_ANIMATION || state === EXIT_ANIMATION) {
this._isAnimating = true;
this._isAnimating.set(true);
}
}

Expand Down
Loading