diff --git a/goldens/material/select/index.api.md b/goldens/material/select/index.api.md index 04382362d004..fb4c41f264fb 100644 --- a/goldens/material/select/index.api.md +++ b/goldens/material/select/index.api.md @@ -274,7 +274,6 @@ export class MatSelect implements AfterContentInit, OnChanges, OnDestroy, OnInit get focused(): boolean; _getAriaActiveDescendant(): string | null; _getPanelAriaLabelledby(): string | null; - _getPanelTheme(): string; _handleKeydown(event: KeyboardEvent): void; protected _handleOverlayKeydown(event: KeyboardEvent): void; get hideSingleSelectionIndicator(): boolean; diff --git a/src/material/select/select.html b/src/material/select/select.html index 084f14e2fbf4..d31f2c834ecd 100644 --- a/src/material/select/select.html +++ b/src/material/select/select.html @@ -43,21 +43,24 @@ [cdkConnectedOverlayUsePopover]="_popoverLocation" (detach)="close()" (backdropClick)="close()" - (overlayKeydown)="_handleOverlayKeydown($event)" -> + (overlayKeydown)="_handleOverlayKeydown($event)"> +
+ (keydown)="_handleKeydown($event)">
diff --git a/src/material/select/select.ts b/src/material/select/select.ts index 222ec39293b6..6292f30c6269 100644 --- a/src/material/select/select.ts +++ b/src/material/select/select.ts @@ -94,7 +94,6 @@ import { getMatSelectNonArrayValueError, getMatSelectNonFunctionValueError, } from './select-errors'; -import {NgClass} from '@angular/common'; /** Injection token that determines the scroll handling while a select is open. */ export const MAT_SELECT_SCROLL_STRATEGY = new InjectionToken<() => ScrollStrategy>( @@ -189,7 +188,7 @@ export class MatSelectChange { {provide: MatFormFieldControl, useExisting: MatSelect}, {provide: MAT_OPTION_PARENT_COMPONENT, useExisting: MatSelect}, ], - imports: [CdkOverlayOrigin, CdkConnectedOverlay, NgClass], + imports: [CdkOverlayOrigin, CdkConnectedOverlay], }) export class MatSelect implements @@ -711,6 +710,10 @@ export class MatSelect if (changes['typeaheadDebounceInterval'] && this._keyManager) { this._keyManager.withTypeAhead(this.typeaheadDebounceInterval); } + + if (changes['panelClass'] && this.panelClass instanceof Set) { + this.panelClass = Array.from(this.panelClass); + } } ngOnDestroy() { @@ -1085,11 +1088,6 @@ export class MatSelect } } - /** Returns the theme to be used on the panel. */ - _getPanelTheme(): string { - return this._parentFormField ? `mat-${this._parentFormField.color}` : ''; - } - /** Whether the select has a value. */ get empty(): boolean { return !this._selectionModel || this._selectionModel.isEmpty();