Commit 9620520
authored
## Description
As pointed out in #3310, `LongPress` on web does not override `onPointerOutOfBounds` method, which leads to gesture not being cancelled even if `maxDistance` was exceeded.
Fixes #3310
## Test plan
<details>
<summary>Tested on the following code:</summary>
```jsx
import React from 'react';
import { StyleSheet, View } from 'react-native';
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
export default function EmptyExample() {
const g = Gesture.LongPress()
.onStart((e) => {
console.log(e);
})
.onFinalize((e, s) => console.log(s))
.shouldCancelWhenOutside(false);
return (
<View style={styles.container}>
<GestureDetector gesture={g}>
<View
style={{
width: 100,
height: 100,
backgroundColor: 'crimson',
}}
/>
</GestureDetector>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
});
```
</details>
1 parent 2a4bad7 commit 9620520
1 file changed
+6
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
104 | 110 | | |
105 | 111 | | |
106 | 112 | | |
| |||
0 commit comments