Commit 1415d55
authored
## Description
Apparently faulty logic in `ReanimatedSwipeable` makes `onSwipeableClose` and `onSwipeableWillClose` callbacks being triggered right after opening swipeable. This PR fixes that behavior.
Fixes #3475
## Test plan
<details>
<summary>Tested on the following code:</summary>
```jsx
import React from 'react';
import { View, Text } from 'react-native';
import Swipeable from 'react-native-gesture-handler/ReanimatedSwipeable';
export default function Example() {
return (
<Swipeable
renderLeftActions={() => {
return (
<View style={{ height: 80, width: 80, backgroundColor: 'yellow' }}>
<Text>Left</Text>
</View>
);
}}
renderRightActions={() => {
return (
<View style={{ height: 80, width: 80, backgroundColor: 'magenta' }}>
<Text>Right</Text>
</View>
);
}}
onSwipeableWillClose={() => console.log('Will close')}>
<View
style={{
height: 80,
backgroundColor: 'blue',
}}
/>
</Swipeable>
);
}
```
</details>
1 parent ece00f2 commit 1415d55
1 file changed
Lines changed: 17 additions & 11 deletions
Lines changed: 17 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
365 | 368 | | |
366 | 369 | | |
367 | 370 | | |
368 | 371 | | |
369 | 372 | | |
370 | | - | |
| 373 | + | |
371 | 374 | | |
372 | 375 | | |
373 | 376 | | |
374 | 377 | | |
375 | 378 | | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
381 | 387 | | |
382 | 388 | | |
383 | 389 | | |
| |||
0 commit comments