Skip to content
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

fix(cdk/overlay): OverlayRef.outsidePointerEvents() should only emit … #23679

Merged
merged 1 commit into from
Oct 19, 2021
Merged

fix(cdk/overlay): OverlayRef.outsidePointerEvents() should only emit … #23679

merged 1 commit into from
Oct 19, 2021

Conversation

kyubisation
Copy link
Contributor

@kyubisation kyubisation commented Oct 3, 2021

…due to pointerdown outside overlay

Currently OverlayRef.outsidePointerEvents() emits when a user starts a click inside the overlay,
drags the cursor outside the overlay and releases the click (e.g. selecting text and moving the
mouse outside the overlay). In order to only emit when the click originates outside the overlay,
we track the target of the preceding pointerdown event and check if it originated from outside
the overlay.

Fixes #23643

@google-cla google-cla bot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Oct 3, 2021
Copy link
Member

@crisbeto crisbeto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@crisbeto crisbeto added merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note action: merge The PR is ready for merge by the caretaker P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release labels Oct 4, 2021
@crisbeto
Copy link
Member

crisbeto commented Oct 4, 2021

Caretaker note: these changes have the potential of breaking tests. We should trigger an exploratory presubmit to get a feel for how breaking it will be.

@kyubisation
Copy link
Contributor Author

I refactored the PR according to the discussion in #23643. The breaking change has been removed and the PR description updated.
(Sorry about breaking the lint check, I'm used to an auto formatter.)

The following scenarios are now covered:

pointerdown click Outcome
inside overlay inside overlay don't emit
inside overlay outside overlay don't emit
outside overlay inside overlay don't emit
outside overlay outside overlay emit
- inside overlay don't emit
- outside overlay emit

I'm open to suggestions for improvement.

…due to pointerdown outside overlay

Currently OverlayRef.outsidePointerEvents() emits when a user starts a click inside the overlay,
drags the cursor outside the overlay and releases the click (e.g. selecting text and moving the
mouse outside the overlay). In order to only emit when the click originates outside the overlay,
we track the target of the preceding pointerdown event and check if it originated from outside
the overlay.

Fixes #23643
@kyubisation
Copy link
Contributor Author

Is there a chance of this landing in v13?

@crisbeto
Copy link
Member

I can't guarantee when it'll land since it has to follow the process for merging pull requests.

@andrewseguin andrewseguin merged commit 335a798 into angular:master Oct 19, 2021
andrewseguin pushed a commit that referenced this pull request Oct 19, 2021
…due to pointerdown outside overlay (#23679)

Currently OverlayRef.outsidePointerEvents() emits when a user starts a click inside the overlay,
drags the cursor outside the overlay and releases the click (e.g. selecting text and moving the
mouse outside the overlay). In order to only emit when the click originates outside the overlay,
we track the target of the preceding pointerdown event and check if it originated from outside
the overlay.

Fixes #23643

(cherry picked from commit 335a798)
andrewseguin pushed a commit that referenced this pull request Oct 19, 2021
…due to pointerdown outside overlay (#23679)

Currently OverlayRef.outsidePointerEvents() emits when a user starts a click inside the overlay,
drags the cursor outside the overlay and releases the click (e.g. selecting text and moving the
mouse outside the overlay). In order to only emit when the click originates outside the overlay,
we track the target of the preceding pointerdown event and check if it originated from outside
the overlay.

Fixes #23643

(cherry picked from commit 335a798)
@kyubisation kyubisation deleted the fix-overlay-outside-click-dispatcher branch October 19, 2021 15:47
forsti0506 pushed a commit to forsti0506/components that referenced this pull request Oct 22, 2021
…due to pointerdown outside overlay (angular#23679)

Currently OverlayRef.outsidePointerEvents() emits when a user starts a click inside the overlay,
drags the cursor outside the overlay and releases the click (e.g. selecting text and moving the
mouse outside the overlay). In order to only emit when the click originates outside the overlay,
we track the target of the preceding pointerdown event and check if it originated from outside
the overlay.

Fixes angular#23643
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Nov 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release
Projects
None yet
3 participants