diff --git a/goldens/material/select/index.api.md b/goldens/material/select/index.api.md index 58da7072077a..ce39f53d3460 100644 --- a/goldens/material/select/index.api.md +++ b/goldens/material/select/index.api.md @@ -361,6 +361,8 @@ export class MatSelect implements AfterContentInit, OnChanges, OnDestroy, OnInit tabIndex: number; toggle(): void; trigger: ElementRef; + // (undocumented) + protected _triggerClicked(): void; get triggerValue(): string; typeaheadDebounceInterval: number; updateErrorState(): void; diff --git a/src/material/select/select.html b/src/material/select/select.html index d31f2c834ecd..36de11f73b7d 100644 --- a/src/material/select/select.html +++ b/src/material/select/select.html @@ -1,7 +1,7 @@
diff --git a/src/material/select/select.ts b/src/material/select/select.ts index 94efdfec1f28..d94410574828 100644 --- a/src/material/select/select.ts +++ b/src/material/select/select.ts @@ -1018,6 +1018,13 @@ export class MatSelect return !this._selectionModel || this._selectionModel.isEmpty(); } + protected _triggerClicked() { + // If a parent form field is present, it'll pick up this click so we don't need to handle it. + if (!this._parentFormField) { + this.open(); + } + } + private _initializeSelection(): void { // Defer setting the value in order to avoid the "Expression // has changed after it was checked" errors from Angular.