MCPcopy Create free account
hub / github.com/angular/components / focus

Method focus

src/material/button/button-base.ts:185–191  ·  view source on GitHub ↗

Focuses the button.

(origin: FocusOrigin = 'program', options?: FocusOptions)

Source from the content-addressed store, hash-verified

183
184 /** Focuses the button. */
185 focus(origin: FocusOrigin = 'program', options?: FocusOptions): void {
186 if (origin) {
187 this._focusMonitor.focusVia(this._elementRef.nativeElement, origin, options);
188 } else {
189 this._elementRef.nativeElement.focus(options);
190 }
191 }
192
193 protected _getAriaDisabled() {
194 if (this.ariaDisabled != null) {

Callers

nothing calls this directly

Calls 2

focusViaMethod · 0.80
focusMethod · 0.65

Tested by

no test coverage detected