Files
react-native/packages
Alex DanoffandFacebook GitHub Bot a449291323 Pressable: disable click bubbling in Pressable (#37542)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/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: 37423fda03992d48baee04b753d7bb9295a76f9b
2023-05-24 14:53:29 -07:00
..