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

Method onClick

src/aria/private/menu/menu.ts:312–321  ·  view source on GitHub ↗

Handles click events for the menu.

(event: MouseEvent)

Source from the content-addressed store, hash-verified

310
311 /** Handles click events for the menu. */
312 onClick(event: MouseEvent) {
313 const relatedTarget = _getEventTarget<Node>(event);
314 const item = this.inputs.items().find(i => i.element()?.contains(relatedTarget));
315
316 if (item) {
317 item.open();
318 this.listBehavior.goto(item);
319 this.submit(item);
320 }
321 }
322
323 /** Handles focusin events for the menu. */
324 onFocusIn() {

Callers 1

menu.spec.tsFile · 0.45

Calls 5

submitMethod · 0.95
_getEventTargetFunction · 0.90
openMethod · 0.65
elementMethod · 0.45
gotoMethod · 0.45

Tested by

no test coverage detected