Skip to content

Conversation

@huextrat
Copy link
Contributor

@huextrat huextrat commented Jan 20, 2026

Description

fixes: #3891
fixes: #3904

This PR fixes pointerEvents support for Pressable component from react-native-gesture-handler on Android.

Waiting for iOS PR: #3925 as codegen is involved and a small iOS changes is needed

Test plan

Tested all pointerEvents modes on Android:

  • 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).

} 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
Copy link
Contributor Author

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 👍

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]>
@huextrat huextrat force-pushed the fix/android-pointerEvents branch from 9f73c29 to 8c24005 Compare January 21, 2026 20:00
@huextrat huextrat marked this pull request as ready for review January 21, 2026 20:27
@huextrat
Copy link
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Pressable] pointerEvents "box-only" and "box-none" broken bug(pressable, iOS): pointerEvents box-none not working

1 participant