Commit 154f204
authored
Add missing handlers callbacks to buttons (#4033)
## Description
In our buttons implementations we override `on*` callbacks for `Native`
gesture (except of `onUpdate`). This PR fixes this issue by calling
originally passed callbacks inside overriden ones.
## Test plan
<details>
<summary>Tested on the following example:</summary>
```tsx
import { StyleSheet } from 'react-native';
import {
RectButton,
GestureHandlerRootView,
} from 'react-native-gesture-handler';
export default function App() {
return (
<GestureHandlerRootView style={styles.container}>
<RectButton
style={styles.box}
onBegin={(e) => {
console.log('onBegin', e, Date.now());
}}
onActivate={(e) => {
console.log('onActivate', e, Date.now());
}}
onUpdate={(e) => {
console.log('onUpdate', e, Date.now());
}}
onDeactivate={(e, s) => {
console.log('onDeactivate', e, s, Date.now());
}}
onFinalize={(e, s) => {
console.log('onFinalize', e, s, Date.now());
}}
/>
</GestureHandlerRootView>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
box: {
width: 200,
height: 50,
borderRadius: 15,
backgroundColor: '#007AFF',
},
});
```
</details>1 parent 9e8c54c commit 154f204
1 file changed
Lines changed: 13 additions & 3 deletions
Lines changed: 13 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
| |||
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
| 55 | + | |
| 56 | + | |
53 | 57 | | |
54 | 58 | | |
55 | 59 | | |
56 | 60 | | |
57 | 61 | | |
58 | 62 | | |
| 63 | + | |
| 64 | + | |
59 | 65 | | |
60 | 66 | | |
61 | | - | |
| 67 | + | |
62 | 68 | | |
63 | 69 | | |
64 | | - | |
| 70 | + | |
65 | 71 | | |
66 | 72 | | |
| 73 | + | |
| 74 | + | |
67 | 75 | | |
68 | 76 | | |
69 | | - | |
| 77 | + | |
70 | 78 | | |
71 | 79 | | |
72 | 80 | | |
73 | 81 | | |
| 82 | + | |
| 83 | + | |
74 | 84 | | |
75 | 85 | | |
76 | 86 | | |
| |||
0 commit comments