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

Function _getCloseStream

src/material/datepicker/datepicker-base.ts:860–880  ·  view source on GitHub ↗

Gets an observable that will emit when the overlay is supposed to be closed.

(overlayRef: OverlayRef)

Source from the content-addressed store, hash-verified

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}

Callers

nothing calls this directly

Calls 4

hasModifierKeyFunction · 0.90
detachmentsMethod · 0.80
backdropClickMethod · 0.45
keydownEventsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…