diff --git a/src/material/stepper/step-header.ts b/src/material/stepper/step-header.ts index 83006d75899..afaf68f0ee5 100644 --- a/src/material/stepper/step-header.ts +++ b/src/material/stepper/step-header.ts @@ -81,6 +81,11 @@ export class MatStepHeader extends CdkStepHeader implements OnDestroy { this._focusMonitor.stopMonitoring(this._elementRef); } + /** Focuses the step header. */ + focus() { + this._focusMonitor.focusVia(this._elementRef, 'program'); + } + /** Returns string label of given step if it is a text label. */ _stringLabel(): string | null { return this.label instanceof MatStepLabel ? null : this.label; diff --git a/tools/public_api_guard/material/stepper.d.ts b/tools/public_api_guard/material/stepper.d.ts index a96b7f9186a..03db5719024 100644 --- a/tools/public_api_guard/material/stepper.d.ts +++ b/tools/public_api_guard/material/stepper.d.ts @@ -35,6 +35,7 @@ export declare class MatStepHeader extends CdkStepHeader implements OnDestroy { _getIconContext(): MatStepperIconContext; _stringLabel(): string | null; _templateLabel(): MatStepLabel | null; + focus(): void; ngOnDestroy(): void; }