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

Method onContainerClick

src/material/select/select.ts:1407–1425  ·  view source on GitHub ↗

* Implemented as part of MatFormFieldControl. * @docs-private

(event: MouseEvent)

Source from the content-addressed store, hash-verified

1405 * @docs-private
1406 */
1407 onContainerClick(event: MouseEvent) {
1408 const target = _getEventTarget(event) as HTMLElement | null;
1409
1410 // Since the overlay is inside the form field, this handler can fire for interactions
1411 // with the container. Note that while it's redundant to select both for the popover
1412 // and select panel, we need to do it because it tests the clicks can occur after
1413 // the panel was detached from the popover.
1414 if (
1415 target &&
1416 (target.tagName === 'MAT-OPTION' ||
1417 target.classList.contains('cdk-overlay-backdrop') ||
1418 target.closest('.mat-mdc-select-panel'))
1419 ) {
1420 return;
1421 }
1422
1423 this.focus();
1424 this.open();
1425 }
1426
1427 /**
1428 * Implemented as part of MatFormFieldControl.

Callers

nothing calls this directly

Calls 3

focusMethod · 0.95
openMethod · 0.95
_getEventTargetFunction · 0.90

Tested by

no test coverage detected