diff --git a/src/cdk-experimental/dialog/dialog-ref.ts b/src/cdk-experimental/dialog/dialog-ref.ts index 96eca8a08f1d..d2da6b3d9b92 100644 --- a/src/cdk-experimental/dialog/dialog-ref.ts +++ b/src/cdk-experimental/dialog/dialog-ref.ts @@ -62,7 +62,7 @@ export class DialogRef { } /** Gets an observable that emits when the overlay's backdrop has been clicked. */ - backdropClick(): Observable { + backdropClick(): Observable { return this._overlayRef.backdropClick(); } diff --git a/src/cdk/overlay/overlay-ref.ts b/src/cdk/overlay/overlay-ref.ts index 6e28b3c5a62a..a54e763f9d97 100644 --- a/src/cdk/overlay/overlay-ref.ts +++ b/src/cdk/overlay/overlay-ref.ts @@ -27,7 +27,7 @@ export type ImmutableObject = { */ export class OverlayRef implements PortalOutlet { private _backdropElement: HTMLElement | null = null; - private _backdropClick: Subject = new Subject(); + private _backdropClick: Subject = new Subject(); private _attachments = new Subject(); private _detachments = new Subject(); @@ -181,7 +181,7 @@ export class OverlayRef implements PortalOutlet { } /** Gets an observable that emits when the backdrop has been clicked. */ - backdropClick(): Observable { + backdropClick(): Observable { return this._backdropClick.asObservable(); } @@ -278,7 +278,8 @@ export class OverlayRef implements PortalOutlet { // Forward backdrop clicks such that the consumer of the overlay can perform whatever // action desired when such a click occurs (usually closing the overlay). - this._backdropElement.addEventListener('click', () => this._backdropClick.next(null)); + this._backdropElement.addEventListener('click', + (event: MouseEvent) => this._backdropClick.next(event)); // Add class to fade-in the backdrop after one frame. if (typeof requestAnimationFrame !== 'undefined') { diff --git a/src/cdk/overlay/overlay.spec.ts b/src/cdk/overlay/overlay.spec.ts index f5c26c5bb156..6fe2dc39d992 100644 --- a/src/cdk/overlay/overlay.spec.ts +++ b/src/cdk/overlay/overlay.spec.ts @@ -388,7 +388,7 @@ describe('Overlay', () => { overlayRef.backdropClick().subscribe(backdropClickHandler); backdrop.click(); - expect(backdropClickHandler).toHaveBeenCalled(); + expect(backdropClickHandler).toHaveBeenCalledWith(jasmine.any(MouseEvent)); }); it('should complete the backdrop click stream once the overlay is destroyed', () => { diff --git a/src/lib/dialog/dialog-ref.ts b/src/lib/dialog/dialog-ref.ts index 60f2522088ef..4faa4692f323 100644 --- a/src/lib/dialog/dialog-ref.ts +++ b/src/lib/dialog/dialog-ref.ts @@ -141,7 +141,7 @@ export class MatDialogRef { /** * Gets an observable that emits when the overlay's backdrop has been clicked. */ - backdropClick(): Observable { + backdropClick(): Observable { return this._overlayRef.backdropClick(); } diff --git a/src/lib/sort/sort-header.ts b/src/lib/sort/sort-header.ts index f77766f179e0..24dfd51410b4 100644 --- a/src/lib/sort/sort-header.ts +++ b/src/lib/sort/sort-header.ts @@ -41,7 +41,7 @@ export const _MatSortHeaderMixinBase = mixinDisabled(MatSortHeaderBase); export type ArrowViewState = SortDirection | 'hint' | 'active'; /** - * States describing the arrow's animated position (animating fromState -> toState). + * States describing the arrow's animated position (animating fromState to toState). * If the fromState is not defined, there will be no animated transition to the toState. * @docs-private */