Commit 78c9ed7
authored
[Web] Fix press out (#3833)
## Description
After
#3678
pressables `onPressOut` did not work on web. This PR fixes the issue.
That PR added a check whether gesture has succeded or not. Because on
web, native gestures fail on mouse move, the finalise was handled by
LongPress.finalize, but the LongPress has minDuration set to INT_32 max
so it never ends succesfully. This creates new tap gesture that which
handles finalise on web.
## Test plan
Tested on the following example
```tsx
import { View } from 'react-native'
import { GestureHandlerRootView, Pressable, ScrollView } from 'react-native-gesture-handler'
export default function Test() {
return (
<GestureHandlerRootView >
<ScrollView style={{ flexGrow: 1, backgroundColor: 'white' }}>
<View style={{ paddingTop: 200, height: 2000 }}>
<Pressable
style={{ width: 30, height: 30, backgroundColor: 'pink' }}
onPress={() => console.log("pressed")}
/>
</View>
</ScrollView>
</GestureHandlerRootView >
)
}
```1 parent 9f0a521 commit 78c9ed7
File tree
1 file changed
+1
-2
lines changed- packages/react-native-gesture-handler/src/components/Pressable
1 file changed
+1
-2
lines changedLines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
251 | | - | |
| 251 | + | |
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
| |||
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
334 | | - | |
335 | 334 | | |
336 | 335 | | |
337 | 336 | | |
| |||
0 commit comments