Repository navigation
Commit c68bf94
[iOS] Keep button hit testing within its own subtree (#4495)
Fixes #4494.
When a disabled `RNGestureHandlerButton` has no eligible touch target,
the hit-test loop can continue past the button and return an ancestor
outside its subtree.
This change returns `nil` when the search reaches the button itself
without finding an eligible target. Eligible descendants can still be
selected before reaching that boundary.
The guard prevents the SwiftUI-backed blur crash in my device testing.
The suspected connection between returning a hosting ancestor and
recursive hit testing is described in the linked issue.
Tested the same boundary guard in my app’s test screen on an iPhone 16
Pro running iOS 26.5.2, using an Expo SDK 57 development build with
React Native 0.86.3 and Gesture Handler 3.2.1.
React Native’s experimental `enableSwiftUIBasedFilters` flag was
enabled.
- Original behaviour: tapping the disabled outer area crashes.
- Boundary guard enabled, pointer-events workaround off: tapping the
same area no longer crashes.
Reproduction project and build instructions:
https://github.com/rileysay/rngh-swiftui-hit-test-repro
The standalone project has built successfully on EAS. The device
observations above were recorded using the test screen in my original
app.
AI assistance: I used Codex to help investigate the native code, prepare
the reproduction project, and propose this patch. I personally verified
the device observations above.1 parent d21cb85 commit c68bf94
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| |||
0 commit comments