-
-
Notifications
You must be signed in to change notification settings - Fork 1k
fix(android): handles pointerEvents for Pressable component
#3927
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
Open
huextrat
wants to merge
3
commits into
software-mansion:main
Choose a base branch
from
huextrat:fix/android-pointerEvents
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
fix(android): handles pointerEvents for Pressable component
#3927
huextrat
wants to merge
3
commits into
software-mansion:main
from
huextrat:fix/android-pointerEvents
+31
−4
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
huextrat
commented
Jan 20, 2026
| } from 'react-native/Libraries/Types/CodegenTypes'; | ||
| import type { ViewProps, ColorValue } from 'react-native'; | ||
|
|
||
| // @ts-ignore - Redefining pointerEvents with WithDefault for codegen, conflicts with ViewProps type but codegen needs it |
Contributor
Author
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Omit is not working with codegen so I had to ignore the error
If anyone has a better idea, don't hesitate 👍
This was referenced Jan 20, 2026
m-bert
added a commit
that referenced
this pull request
Jan 21, 2026
## Description fixes: #3891 fixes: #3904 This PR implements `pointerEvents` support for `Pressable` component from `react-native-gesture-handler` on iOS. Previously, setting `pointerEvents="box-none"` (or other modes) had no effect on iOS, while it worked correctly <s>on Android</s> and with React Native's `Pressable` on iOS. Android PR: #3927 ### Implementation Details The implementation follows React Native's `hitTest` logic for `pointerEvents`: - For `box-only`: Returns `self` if point is inside (respecting `hitSlop`), `nil` otherwise - For `box-none`: Checks subviews only, returns the hit subview or `nil` - For `none`: Always returns `nil` - For `auto`: Uses standard hit testing with `shouldHandleTouch` logic The implementation respects `hitTestEdgeInsets` (hitSlop) for all modes, ensuring consistent behavior with React Native's `Pressable`. ## Test plan Tested all `pointerEvents` modes on iOS: - ✅ `pointerEvents="none"` - View and subviews don't receive touches - ✅ `pointerEvents="box-none"` - View doesn't receive touches, subviews do - ✅ `pointerEvents="box-only"` - View receives touches, subviews don't - ✅ `pointerEvents="auto"` - Default behavior works as expected I've used https://github.com/huextrat/repro-pressable-gh to test scenarios Tested on both old architecture (Paper) and new architecture (Fabric). edit: `pointerEvents` with RNGH Pressable is not working on Android --------- Co-authored-by: Michał <[email protected]>
9f73c29 to
8c24005
Compare
Contributor
Author
|
@m-bert Following the fix for iOS, here is the fix for Android 👍 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
fixes: #3891
fixes: #3904
This PR fixes
pointerEventssupport forPressablecomponent fromreact-native-gesture-handleron Android.Waiting for iOS PR: #3925 as codegen is involved and a small iOS changes is needed
Test plan
Tested all
pointerEventsmodes on Android:pointerEvents="none"- View and subviews don't receive touchespointerEvents="box-none"- View doesn't receive touches, subviews dopointerEvents="box-only"- View receives touches, subviews don'tpointerEvents="auto"- Default behavior works as expectedI've used https://github.com/huextrat/repro-pressable-gh to test scenarios
Tested on both old architecture (Paper) and new architecture (Fabric).