Skip to content

Pressable: disable click bubbling in Pressable#37542

Closed
adanoff wants to merge 1 commit into
facebook:mainfrom
adanoff:export-D46081810
Closed

Pressable: disable click bubbling in Pressable#37542
adanoff wants to merge 1 commit into
facebook:mainfrom
adanoff:export-D46081810

Conversation

@adanoff
Copy link
Copy Markdown

@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
Copy Markdown
Contributor

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

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

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

@adanoff adanoff force-pushed the export-D46081810 branch from 2960e33 to d6d5712 Compare May 24, 2023 13:53
@analysis-bot
Copy link
Copy Markdown

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 adanoff force-pushed the export-D46081810 branch from d6d5712 to a367531 Compare May 24, 2023 18:10
@facebook-github-bot
Copy link
Copy Markdown
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
Copy Markdown
Contributor

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

@adanoff adanoff force-pushed the export-D46081810 branch from a367531 to e58a897 Compare May 24, 2023 19:59
@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label May 24, 2023
@facebook-github-bot
Copy link
Copy Markdown
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