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

W3CPointerEvents: properly update hit path during native gestures #37638

Closed
wants to merge 1 commit into from

Conversation

adanoff
Copy link

@adanoff adanoff commented May 31, 2023

Summary:
Changelog: [Android] [Fixed] - W3CPointerEvents: properly update hit path during native gestures

Per the W3C spec, we need to fire pointerout and pointerleave after firing a pointercancel. However, in cases where the pointer doesn't physically leave the target after a cancel (e.g. scrolling by clicking and dragging), we would never re-fire a pointerenter event once the native gesture was completed. This change fixes the bug by clearing out the last hit path (and other relevant state) for the pointer when we start handling a native gesture. Then we'll re-fire a pointerenter as expected upon the next motion event (due to the logic in handleHitStateDivergence).

Note: this bug only affected hovering pointers (e.g. mouse) because for non-hovering pointers the native gesture won't end unless the pointer is physically removed (i.e. finger is lifted).

Reviewed By: javache

Differential Revision: D46226021

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner fb-exported labels May 31, 2023
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D46226021

@analysis-bot
Copy link

analysis-bot commented May 31, 2023

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,744,464 +52
android hermes armeabi-v7a 8,056,627 +52
android hermes x86 9,235,565 +50
android hermes x86_64 9,086,367 +37
android jsc arm64-v8a 9,307,262 +286
android jsc armeabi-v7a 8,496,806 +298
android jsc x86 9,369,282 +303
android jsc x86_64 9,624,203 +312

Base commit: 3f0caed
Branch: main

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D46226021

adanoff pushed a commit to adanoff/react-native that referenced this pull request May 31, 2023
…cebook#37638)

Summary:
Pull Request resolved: facebook#37638

Changelog: [Android] [Fixed]  - W3CPointerEvents: properly update hit path during native gestures

Per [the W3C spec](https://www.w3.org/TR/pointerevents/#the-pointercancel-event), we need to fire pointerout and pointerleave after firing a pointercancel. However, in cases where the pointer doesn't physically leave the target after a cancel (e.g. scrolling by clicking and dragging), we would never re-fire a pointerenter event once the native gesture was completed. This change fixes the bug by clearing out the last hit path (and other relevant state) for the pointer when we start handling a native gesture. Then we'll re-fire a pointerenter as expected upon the next motion event (due to the logic in handleHitStateDivergence).

Note: this bug only affected hovering pointers (e.g. mouse) because for non-hovering pointers the native gesture won't end unless the pointer is physically removed (i.e. finger is lifted).

Reviewed By: javache

Differential Revision: D46226021

fbshipit-source-id: 66d53aa885a4c3029aeb6d74c8556863dac9b635
@adanoff adanoff force-pushed the export-D46226021 branch from 2626f96 to 60c31ae Compare May 31, 2023 21:10
adanoff pushed a commit to adanoff/react-native that referenced this pull request Jun 1, 2023
…cebook#37638)

Summary:
Pull Request resolved: facebook#37638

Changelog: [Android] [Fixed]  - W3CPointerEvents: properly update hit path during native gestures

Per [the W3C spec](https://www.w3.org/TR/pointerevents/#the-pointercancel-event), we need to fire pointerout and pointerleave after firing a pointercancel. However, in cases where the pointer doesn't physically leave the target after a cancel (e.g. scrolling by clicking and dragging), we would never re-fire a pointerenter event once the native gesture was completed. This change fixes the bug by clearing out the last hit path (and other relevant state) for the pointer when we start handling a native gesture. Then we'll re-fire a pointerenter as expected upon the next motion event (due to the logic in handleHitStateDivergence).

Note: this bug only affected hovering pointers (e.g. mouse) because for non-hovering pointers the native gesture won't end unless the pointer is physically removed (i.e. finger is lifted).

Reviewed By: javache

Differential Revision: D46226021

fbshipit-source-id: c583771b99efd1480b51e44bb0bf0a9f3a97779b
@adanoff adanoff force-pushed the export-D46226021 branch from 60c31ae to 047200b Compare June 1, 2023 14:12
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D46226021

adanoff pushed a commit to adanoff/react-native that referenced this pull request Jun 1, 2023
…cebook#37638)

Summary:
Pull Request resolved: facebook#37638

Changelog: [Android] [Fixed]  - W3CPointerEvents: properly update hit path during native gestures

Per [the W3C spec](https://www.w3.org/TR/pointerevents/#the-pointercancel-event), we need to fire pointerout and pointerleave after firing a pointercancel. However, in cases where the pointer doesn't physically leave the target after a cancel (e.g. scrolling by clicking and dragging), we would never re-fire a pointerenter event once the native gesture was completed. This change fixes the bug by clearing out the last hit path (and other relevant state) for the pointer when we start handling a native gesture. Then we'll re-fire a pointerenter as expected upon the next motion event (due to the logic in handleHitStateDivergence).

Note: this bug only affected hovering pointers (e.g. mouse) because for non-hovering pointers the native gesture won't end unless the pointer is physically removed (i.e. finger is lifted).

Reviewed By: javache

Differential Revision: D46226021

fbshipit-source-id: b5dbd2982f72c877a6f0cdbb91c8549bdc739050
@adanoff adanoff force-pushed the export-D46226021 branch from 047200b to ddeaf15 Compare June 1, 2023 19:40
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D46226021

1 similar comment
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D46226021

@adanoff adanoff force-pushed the export-D46226021 branch from ddeaf15 to 63be6e2 Compare June 6, 2023 15:12
adanoff pushed a commit to adanoff/react-native that referenced this pull request Jun 6, 2023
…cebook#37638)

Summary:
Pull Request resolved: facebook#37638

Changelog: [Android] [Fixed]  - W3CPointerEvents: properly update hit path during native gestures

Per [the W3C spec](https://www.w3.org/TR/pointerevents/#the-pointercancel-event), we need to fire pointerout and pointerleave after firing a pointercancel. However, in cases where the pointer doesn't physically leave the target after a cancel (e.g. scrolling by clicking and dragging), we would never re-fire a pointerenter event once the native gesture was completed. This change fixes the bug by clearing out the last hit path (and other relevant state) for the pointer when we start handling a native gesture. Then we'll re-fire a pointerenter as expected upon the next motion event (due to the logic in handleHitStateDivergence).

Note: this bug only affected hovering pointers (e.g. mouse) because for non-hovering pointers the native gesture won't end unless the pointer is physically removed (i.e. finger is lifted).

Reviewed By: javache

Differential Revision: D46226021

fbshipit-source-id: 585ebb806d2e1417f8f6fb462b85b3ddf4ae2b41
adanoff pushed a commit to adanoff/react-native that referenced this pull request Jun 6, 2023
…cebook#37638)

Summary:
Pull Request resolved: facebook#37638

Changelog: [Android] [Fixed]  - W3CPointerEvents: properly update hit path during native gestures

Per [the W3C spec](https://www.w3.org/TR/pointerevents/#the-pointercancel-event), we need to fire pointerout and pointerleave after firing a pointercancel. However, in cases where the pointer doesn't physically leave the target after a cancel (e.g. scrolling by clicking and dragging), we would never re-fire a pointerenter event once the native gesture was completed. This change fixes the bug by clearing out the last hit path (and other relevant state) for the pointer when we start handling a native gesture. Then we'll re-fire a pointerenter as expected upon the next motion event (due to the logic in handleHitStateDivergence).

Note: this bug only affected hovering pointers (e.g. mouse) because for non-hovering pointers the native gesture won't end unless the pointer is physically removed (i.e. finger is lifted).

Reviewed By: javache

Differential Revision: D46226021

fbshipit-source-id: fb417bdab14167fe6f3020ff269aa80f6a3fffb9
@adanoff adanoff force-pushed the export-D46226021 branch from 63be6e2 to ded6781 Compare June 6, 2023 17:48
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D46226021

…cebook#37638)

Summary:
Pull Request resolved: facebook#37638

Changelog: [Android] [Fixed]  - W3CPointerEvents: properly update hit path during native gestures

Per [the W3C spec](https://www.w3.org/TR/pointerevents/#the-pointercancel-event), we need to fire pointerout and pointerleave after firing a pointercancel. However, in cases where the pointer doesn't physically leave the target after a cancel (e.g. scrolling by clicking and dragging), we would never re-fire a pointerenter event once the native gesture was completed. This change fixes the bug by clearing out the last hit path (and other relevant state) for the pointer when we start handling a native gesture. Then we'll re-fire a pointerenter as expected upon the next motion event (due to the logic in handleHitStateDivergence).

Note: this bug only affected hovering pointers (e.g. mouse) because for non-hovering pointers the native gesture won't end unless the pointer is physically removed (i.e. finger is lifted).

Reviewed By: javache

Differential Revision: D46226021

fbshipit-source-id: 1267b6e122dfd4aafd47028d87c9be7e95d7a001
@adanoff adanoff force-pushed the export-D46226021 branch from ded6781 to fe48f6c Compare June 6, 2023 18:45
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D46226021

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Jun 6, 2023
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 396cdac.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants