Skip to content

Commit 334fc91

Browse files
committed
fixup! fix(material/select): switch away from animations module
1 parent 94e7230 commit 334fc91

File tree

3 files changed

+6
-16
lines changed

3 files changed

+6
-16
lines changed

src/material/select/select.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@
3939
[cdkConnectedOverlayOrigin]="_preferredOverlayOrigin || fallbackOverlayOrigin"
4040
[cdkConnectedOverlayPositions]="_positions"
4141
[cdkConnectedOverlayWidth]="_overlayWidth"
42-
(backdropClick)="close()"
43-
(detach)="openedChange.emit(false)">
42+
(backdropClick)="close()">
4443
<div
4544
#panel
4645
role="listbox"
@@ -52,7 +51,6 @@
5251
[attr.aria-label]="ariaLabel || null"
5352
[attr.aria-labelledby]="_getPanelAriaLabelledby()"
5453
[ngClass]="panelClass"
55-
(animationend)="_handleAnimationEndEvent($event)"
5654
(keydown)="_handleKeydown($event)">
5755
<ng-content></ng-content>
5856
</div>

src/material/select/select.ts

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -757,11 +757,8 @@ export class MatSelect
757757
// Required for the MDC form field to pick up when the overlay has been opened.
758758
this.stateChanges.next();
759759

760-
// This usually fires at the end of the animation,
761-
// but that won't happen if animations are disabled.
762-
if (this._animationsDisabled) {
763-
this.openedChange.emit(true);
764-
}
760+
// Simulate the animation event before we moved away from `@angular/animations`.
761+
setTimeout(() => this.openedChange.emit(true));
765762
}
766763

767764
/**
@@ -839,6 +836,9 @@ export class MatSelect
839836
this._onTouched();
840837
// Required for the MDC form field to pick up when the overlay has been closed.
841838
this.stateChanges.next();
839+
840+
// Simulate the animation event before we moved away from `@angular/animations`.
841+
setTimeout(() => this.openedChange.emit(false));
842842
}
843843
}
844844

@@ -1078,13 +1078,6 @@ export class MatSelect
10781078
return !this._selectionModel || this._selectionModel.isEmpty();
10791079
}
10801080

1081-
/** Handles animation events from the panel. */
1082-
protected _handleAnimationEndEvent(event: AnimationEvent) {
1083-
if (event.target === this.panel.nativeElement && event.animationName === '_mat-select-enter') {
1084-
this.openedChange.emit(true);
1085-
}
1086-
}
1087-
10881081
private _initializeSelection(): void {
10891082
// Defer setting the value in order to avoid the "Expression
10901083
// has changed after it was checked" errors from Angular.

tools/public_api_guard/material/select.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ export class MatSelect implements AfterContentInit, OnChanges, OnDestroy, OnInit
114114
_getAriaActiveDescendant(): string | null;
115115
_getPanelAriaLabelledby(): string | null;
116116
_getPanelTheme(): string;
117-
protected _handleAnimationEndEvent(event: AnimationEvent): void;
118117
_handleKeydown(event: KeyboardEvent): void;
119118
get hideSingleSelectionIndicator(): boolean;
120119
set hideSingleSelectionIndicator(value: boolean);

0 commit comments

Comments
 (0)