Commit 5dd89da
authored
[Web] fixed texinput submition when inside pressable (#3623)
## Description
Fixes issue #3622. On web, when we submitted `TextInput` using enter,
which was inside `Pressable`, then Gesture Handler didn't recognize any
subsqeuent taps or gestures. Tap gesture was kept in active state, and
caused all other gestures to fail.
## Test plan
```ts
import React from 'react';
import { useState } from 'react';
import { View } from 'react-native';
import { Pressable, TextInput } from 'react-native-gesture-handler';
export default function EmptyExample() {
const [shown, setShown] = useState(true)
return (
<View>
<Pressable key="2" style={{ backgroundColor: 'red', width: 100, height: 60 }} testID="bad-pressable" onPress={() => { console.log("pressed") }}>
{shown ? <TextInput
style={{ backgroundColor: 'green', width: 100, height: 60 }}
onSubmitEditing={() => { console.log("submit"); setShown(false); }}
/> : <View ></View>}
</Pressable >
</View >
)
};
```1 parent 639836a commit 5dd89da
File tree
1 file changed
+50
-8
lines changed- packages/react-native-gesture-handler/src/web/tools
1 file changed
+50
-8
lines changedLines changed: 50 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
| 6 | + | |
| 7 | + | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
9 | 25 | | |
10 | 26 | | |
11 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
12 | 31 | | |
13 | 32 | | |
14 | 33 | | |
15 | 34 | | |
16 | | - | |
| 35 | + | |
17 | 36 | | |
18 | 37 | | |
19 | 38 | | |
20 | 39 | | |
21 | 40 | | |
22 | 41 | | |
23 | | - | |
24 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
25 | 47 | | |
26 | 48 | | |
27 | 49 | | |
| |||
53 | 75 | | |
54 | 76 | | |
55 | 77 | | |
56 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
57 | 89 | | |
58 | 90 | | |
59 | 91 | | |
60 | 92 | | |
61 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
62 | 104 | | |
63 | 105 | | |
64 | 106 | | |
| |||
0 commit comments