You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Description
### Problem
Currently the following configuration:
```jsx
<GestureDetector ... >
<Text> ... </Text>
</GestureDetector>
```
does not work on `iOS`. This is due to change `react-native` introduced in 0.79 - `hitTest` in `RCTParagraphTextView` now returns `nil` by default ([see here](https://github.com/facebook/react-native/blob/dcbbf275cbc4150820691a4fbc254b198cc92bdd/packages/react-native/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm#L379)). This results in native `UIGestureRecognizer` not responding to touches.
### Solution
We no longer attach native recognizer to `RCTParagraphTextView`, but to its parent - `RCTParagraphComponentView`. The problem with this approach is that `handleGesture` method uses `reactTag` property, which on `RCTParagraphComponentView` is `nil`. This is why we use `reactTag` from `RCTParagraphTextView` when sending event to `JS` side.
Fixes#3581
## Test plan
<details>
<summary>Tested on the following code:</summary>
```jsx
import React from 'react';
import { StyleSheet, Text } from 'react-native';
import {
Gesture,
GestureDetector,
GestureHandlerRootView,
} from 'react-native-gesture-handler';
export default function EmptyExample() {
const g = Gesture.Tap().onEnd(() => {
console.log('Tapped!');
});
return (
<GestureHandlerRootView style={styles.container}>
<GestureDetector gesture={g}>
<Text>
Click me
<Text> Me too! </Text>
</Text>
</GestureDetector>
</GestureHandlerRootView>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
});
```
</details>
0 commit comments