Skip to content

Conversation

@huextrat
Copy link
Contributor

@huextrat huextrat commented Jan 18, 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 on Android 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

@huextrat huextrat requested a review from m-bert January 20, 2026 11:07
Copy link
Contributor

@m-bert m-bert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this PR! Just one more thing and it should be ready to go 🎉

@huextrat huextrat requested a review from m-bert January 20, 2026 12:42
@huextrat huextrat changed the title fix: handles pointerEvents for Pressable component fix(iOS): handles pointerEvents for Pressable component Jan 20, 2026
Copy link
Contributor

@m-bert m-bert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since I didn't want to bother you anymore I took the liberty of adding some minor changes (newline and header) to match other enums.

Thank you very match for this PR ❤️

@m-bert m-bert merged commit 59a5311 into software-mansion:main Jan 21, 2026
4 checks passed
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

2 participants