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

Method onClick

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

Handles click events for the menu.

(event: MouseEvent)

Source from the content-addressed store, hash-verified

322
323 /** Handles click events for the menu. */
324 onClick(event: MouseEvent) {
325 const relatedTarget = _getEventTarget<Node>(event);
326 const item = this.inputs.items().find(i => i.element()?.contains(relatedTarget));
327
328 if (item) {
329 item.open();
330 this.listBehavior.goto(item);
331 this.submit(item);
332 }
333 }
334
335 /** Handles focusin events for the menu. */
336 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