MCPcopy Index your code
hub / github.com/angular/components / onContainerClick

Method onContainerClick

src/material/select/select.ts:1405–1423  ·  view source on GitHub ↗

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

(event: MouseEvent)

Source from the content-addressed store, hash-verified

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