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

Method onClick

src/aria/private/menu/menu.ts:315–324  ·  view source on GitHub ↗

Handles click events for the menu.

(event: MouseEvent)

Source from the content-addressed store, hash-verified

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