Gets an observable that will emit when the overlay is supposed to be closed.
(overlayRef: OverlayRef)
| 858 | |
| 859 | /** Gets an observable that will emit when the overlay is supposed to be closed. */ |
| 860 | private _getCloseStream(overlayRef: OverlayRef) { |
| 861 | const ctrlShiftMetaModifiers: ModifierKey[] = ['ctrlKey', 'shiftKey', 'metaKey']; |
| 862 | return merge( |
| 863 | overlayRef.backdropClick(), |
| 864 | overlayRef.detachments(), |
| 865 | overlayRef.keydownEvents().pipe( |
| 866 | filter(event => { |
| 867 | // Closing on alt + up is only valid when there's an input associated with the datepicker. |
| 868 | return ( |
| 869 | (event.keyCode === ESCAPE && !hasModifierKey(event)) || |
| 870 | (this.datepickerInput && |
| 871 | hasModifierKey(event, 'altKey') && |
| 872 | event.keyCode === UP_ARROW && |
| 873 | ctrlShiftMetaModifiers.every( |
| 874 | (modifier: ModifierKey) => !hasModifierKey(event, modifier), |
| 875 | )) |
| 876 | ); |
| 877 | }), |
| 878 | ), |
| 879 | ); |
| 880 | } |
| 881 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…