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

Pressable: disable click bubbling in Pressable #37542

Closed
wants to merge 1 commit into from

Conversation

adanoff
Copy link

@adanoff adanoff commented May 23, 2023

Summary:
Changelog: [General] [Changed] - Pressable: prevent click bubbling in Pressable

This diff modifies pressability such that onClick events for pressables will only result in onPress being called when the pressable in question is both the target and the currentTarget for the event.

This is only really relevant for nested pressables, where click received by the inner pressable may bubble up to the parent pressable (this change effectively prevents that from happening). A future change will update the click event on Android to be bubbling (currently its a direct event); this change will reduce the possibility of breakages from that change.

Reviewed By: vincentriemer

Differential Revision: D46081810

@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 23, 2023
@facebook-github-bot
Copy link
Contributor

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

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

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

adanoff pushed a commit to adanoff/react-native that referenced this pull request May 24, 2023
Summary:
Pull Request resolved: facebook#37542

Changelog: [General] [Changed] - Pressable: prevent click bubbling in Pressable

This diff modifies pressability such that `onClick` events for pressables will only result in `onPress` being called when the pressable in question is both the `target` and the `currentTarget` for the event.

This is only really relevant for nested pressables, where `click` received by the inner pressable may bubble up to the parent pressable (this change effectively prevents that from happening). A future change will update the click event on Android to be bubbling (currently its a direct event); this change will reduce the possibility of breakages from that change.

Reviewed By: vincentriemer

Differential Revision: D46081810

fbshipit-source-id: ed38ee30061e7160ab90305f85367fc095301025
@analysis-bot
Copy link

analysis-bot commented May 24, 2023

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,740,887 +72
android hermes armeabi-v7a 8,051,788 +79
android hermes x86 9,231,078 +88
android hermes x86_64 9,082,916 +81
android jsc arm64-v8a 9,303,207 +32
android jsc armeabi-v7a 8,491,708 +39
android jsc x86 9,364,472 +29
android jsc x86_64 9,620,416 +34

Base commit: be8af22
Branch: main

adanoff pushed a commit to adanoff/react-native that referenced this pull request May 24, 2023
Summary:
Pull Request resolved: facebook#37542

Changelog: [General] [Changed] - Pressable: prevent click bubbling in Pressable

This diff modifies pressability such that `onClick` events for pressables will only result in `onPress` being called when the pressable in question is both the `target` and the `currentTarget` for the event.

This is only really relevant for nested pressables, where `click` received by the inner pressable may bubble up to the parent pressable (this change effectively prevents that from happening). A future change will update the click event on Android to be bubbling (currently its a direct event); this change will reduce the possibility of breakages from that change.

Reviewed By: vincentriemer

Differential Revision: D46081810

fbshipit-source-id: e2a3d0c5126f981101e8ca3b1dce3a6ab5a83261
@facebook-github-bot
Copy link
Contributor

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

Summary:
Pull Request resolved: facebook#37542

Changelog: [General] [Changed] - Pressable: prevent click bubbling in Pressable

This diff modifies pressability such that `onClick` events for pressables will only result in `onPress` being called when the pressable in question is both the `target` and the `currentTarget` for the event.

This is only really relevant for nested pressables, where `click` received by the inner pressable may bubble up to the parent pressable (this change effectively prevents that from happening). A future change will update the click event on Android to be bubbling (currently its a direct event); this change will reduce the possibility of breakages from that change.

Reviewed By: vincentriemer

Differential Revision: D46081810

fbshipit-source-id: 1be1126a03b56b87a603be499d486a90abbcbfa3
@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in a449291.

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