Closed yatessss closed 1 month ago
Hi @yatessss! Thanks for submitting this PR 😄 Before we merge it, could you please provide a reproduction? I have not noticed those problems with swipeables.
Hi @yatessss! Thanks for submitting this PR 😄 Before we merge it, could you please provide a reproduction? I have not noticed those problems with swipeables.
Hello, I have conducted extensive testing and found that the issue may lie with react-native-web
. Registering DOM nodes using React
works fine, but registering DOM nodes through react-native-web
causes problems (e.g., swiping left to open becomes ineffective once). By commenting out the two sections of code separately in the main.tsx
file, the issue can be reproduced.
https://stackblitz.com/edit/vitejs-react-native-gesture-handler-k8wghi-sgju9p?file=src%2Fmain.tsx
I'm not sure what issues occurred with react-native-web, but with the modifications made in this pull request, the example can now run properly.
Maybe I've missed something, but your example seems to work:
Maybe I've missed something, but your example seems to work:
Nagranie.z.ekranu.2024-03-13.o.15.50.50.mov
If you swipe from right to left to open and swipe from left to right to close, you will encounter the issue.😂😂
Okay, now I see what you're talking about. I think it can be done in a different way since resetProgress
method is used, as it's name suggests, to reset handler progress (for example set scale
in Pinch
to 1
).
I don't want to close your PR since you're the one who found this problem and it would be great if you could fix it 😄 What I suggest is changing
if (!this.enabled && this.isFinished()) {
this.currentState = State.UNDETERMINED;
}
to
if (this.isFinished()) {
this.currentState = State.UNDETERMINED;
}
in moveToState
method inside GestureHandler.ts
file.
You can check if it solves your problem and if it does we will merge it :smile:
ok, thanks for your suggestion. i will make the changes to this PR and commit changes after confirming that it runs smoothly.
Although the issue has been resolved, I would still like to understand the specific reasons behind it. Why does registering with react-native-web cause this problem?
@yatessss Sadly, right now I can't answer this question 😞 If I find some time to investigate it, I will try to dive deeper into this problem.
Description
After swiping closed, the component did not reset
this.currentState
toState.UNDETERMINED
internally, which prevents the execution of the swipe open method.Test plan