Skip to content

build: fix formatting failure #24064

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions src/cdk/overlay/dispatchers/overlay-outside-click-dispatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class OverlayOutsideClickDispatcher extends BaseOverlayDispatcher {
/** Store pointerdown event target to track origin of click. */
private _pointerDownListener = (event: PointerEvent) => {
this._pointerDownEventTarget = _getEventTarget(event);
}
};

/** Click event listener that will be attached to the body propagate phase. */
private _clickListener = (event: MouseEvent) => {
Expand All @@ -86,8 +86,10 @@ export class OverlayOutsideClickDispatcher extends BaseOverlayDispatcher {
// This is done by using the event target of the preceding pointerdown event.
// Every click event caused by a pointer device has a preceding pointerdown
// event, unless the click was programmatically triggered (e.g. in a unit test).
const origin = event.type === 'click' && this._pointerDownEventTarget
? this._pointerDownEventTarget : target;
const origin =
event.type === 'click' && this._pointerDownEventTarget
? this._pointerDownEventTarget
: target;
// Reset the stored pointerdown event target, to avoid having it interfere
// in subsequent events.
this._pointerDownEventTarget = null;
Expand All @@ -110,8 +112,10 @@ export class OverlayOutsideClickDispatcher extends BaseOverlayDispatcher {
// If it's a click inside the overlay, just break - we should do nothing
// If it's an outside click (both origin and target of the click) dispatch the mouse event,
// and proceed with the next overlay
if (overlayRef.overlayElement.contains(target as Node) ||
overlayRef.overlayElement.contains(origin as Node)) {
if (
overlayRef.overlayElement.contains(target as Node) ||
overlayRef.overlayElement.contains(origin as Node)
) {
break;
}

Expand Down