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

Method close

src/material/select/select.ts:755–768  ·  view source on GitHub ↗

Closes the overlay panel and focuses the host element.

()

Source from the content-addressed store, hash-verified

753
754 /** Closes the overlay panel and focuses the host element. */
755 close(): void {
756 if (this._panelOpen) {
757 this._panelOpen = false;
758 this._exitAndDetach();
759 this._keyManager.withHorizontalOrientation(this._isRtl() ? 'rtl' : 'ltr');
760 this._changeDetectorRef.markForCheck();
761 this._onTouched();
762 // Required for the MDC form field to pick up when the overlay has been closed.
763 this.stateChanges.next();
764
765 // Simulate the animation event before we moved away from `@angular/animations`.
766 Promise.resolve().then(() => this.openedChange.emit(false));
767 }
768 }
769
770 /** Triggers the exit animation and detaches the overlay at the end. */
771 private _exitAndDetach() {

Callers 8

toggleMethod · 0.95
_handleOpenKeydownMethod · 0.95
_handleOverlayKeydownMethod · 0.95
_initKeyManagerMethod · 0.95
_resetOptionsMethod · 0.95
constructorMethod · 0.45
dismissMethod · 0.45
select.spec.tsFile · 0.45

Calls 7

_exitAndDetachMethod · 0.95
_isRtlMethod · 0.95
markForCheckMethod · 0.80
_onTouchedMethod · 0.80
resolveMethod · 0.80
nextMethod · 0.45

Tested by

no test coverage detected