Closes the overlay panel and focuses the host element.
()
| 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() { |
no test coverage detected