react-native-gesture-handler icon indicating copy to clipboard operation
react-native-gesture-handler copied to clipboard

[Fabric, iOS] Gesture not detected when returning back to screen when `detachInactiveScreens` is set to `false`

Open MatiPl01 opened this issue 5 months ago • 0 comments

Description

Gesture handler, similarly to reanimated, doesn't work properly when detachInactiveScreens is set to false on the navigator (tested on bottom tabs, likely other navigators, like stack, are affected as well).

This is the Fabric iOS-only bug.

[!IMPORTANT]
This issue happens only when react-native-reanimated is installed in the project, so either something is wrong in Reanimated or with the integration of GH and Reanimated.

I think that this issue report under my package is related: https://github.com/MatiPl01/react-native-sortables/issues/349

This issue no longer happens when I disable react-native-screens integration via: enableScreens(false);

https://github.com/user-attachments/assets/7b2cbd46-813b-4564-8372-0007ee22c93d

Steps to reproduce

  1. Copy code from the attached expo snack and run it on the New Architecture on iOS
  2. Press on boxes on the Screen 1 to see that they recognize touches properly
  3. Navigate to the Screen 2 and observe the same behavior
  4. Navigate back to the Screen 1 and see that no more touches are recognized
  5. Navigate to the Screen 2 and observe the same behavior

A link to a Gist, an Expo Snack or a link to a repository based on this template that reproduces the bug.

https://snack.expo.dev/@matipl01/gesture-handler-not-working-after-screen-change?platform=ios

Gesture Handler version

2.26.0 (and older)

React Native version

0.80.0 (and older)

Platforms

iOS

JavaScript runtime

Hermes

Workflow

None

Architecture

New Architecture (Fabric)

Build type

None

Device

None

Device model

No response

Acknowledgements

Yes

MatiPl01 avatar Jun 15 '25 14:06 MatiPl01