Commit 5077539
committed
## Description
On iOS, `onFinalize` callback is not triggered when `Tap` fails. Turns
out that `handleGesture:` is not called from `interactionsCancelled`
method. This PR fixes this problem.
## Test plan
Tested on iOS 26.1 and 18.5.
<details>
<summary>Tested on the following example:</summary>
```tsx
import { StyleSheet, View } from 'react-native';
import {
GestureDetector,
GestureHandlerRootView,
useTapGesture,
} from 'react-native-gesture-handler';
export default function App() {
const tap = useTapGesture({
onFinalize: () => {
console.log('[tap] onFinalize');
},
onTouchesCancel: () => {
console.log('[tap] onTouchesCancel');
},
});
return (
<GestureHandlerRootView style={styles.container}>
<GestureDetector gesture={tap}>
<View style={styles.box} />
</GestureDetector>
</GestureHandlerRootView>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
box: {
width: 100,
height: 100,
backgroundColor: 'crimson',
borderRadius: 10,
},
});
```
</details>
1 parent e7e8506 commit 5077539
1 file changed
Lines changed: 2 additions & 0 deletions
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| 146 | + | |
| 147 | + | |
146 | 148 | | |
147 | 149 | | |
148 | 150 | | |
| |||
0 commit comments