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

Function focus

src/material/menu/menu-trigger-base.ts:264–270  ·  view source on GitHub ↗

* Focuses the menu trigger. * @param origin Source of the menu trigger's focus.

(origin?: FocusOrigin, options?: FocusOptions)

Source from the content-addressed store, hash-verified

262 * @param origin Source of the menu trigger's focus.
263 */
264 focus(origin?: FocusOrigin, options?: FocusOptions) {
265 if (this._focusMonitor && origin) {
266 this._focusMonitor.focusVia(this._element, origin, options);
267 } else {
268 this._element.nativeElement.focus(options);
269 }
270 }
271
272 /** Closes the menu and does the necessary cleanup. */
273 protected _destroyMenu(reason: MenuCloseReason) {

Callers

nothing calls this directly

Calls 2

focusViaMethod · 0.80
focusMethod · 0.65

Tested by

no test coverage detected