Commit ebab88e
authored
Fix buttons getting stuck in scroll views during overscroll (#3509)
## Description
Addresses the issue reported in
#3350.
Conceptually, it's very similar to the above PR. The main difference is
the timing - the above PR cancelled the button during `onReset`, while
this one adds `onFail` method (analogous to `onCancel`). This method is
called just before the state change, while the timing of `onReset` is
dependent on the incoming touch stream and handling of other gestures.
With this change, I wasn't able to reproduce the issue anymore, though
@latekvo mentioned that he was able to get into a situation where none
of `onCancel`, `onFail`, and `onReset` were called. This would likely
manifest in the same way, but it looks like an entirely different
problem. Here, the gesture was canceled, while the underlying button was
still kept as a touch responder, while in the above situation, the
gesture would have never finished (or never activated).
## Test plan
Tested on the linked reproducer and on the Example app1 parent 4c18243 commit ebab88e
File tree
2 files changed
+7
-1
lines changed- packages/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/core
2 files changed
+7
-1
lines changedLines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
685 | 685 | | |
686 | 686 | | |
687 | 687 | | |
| 688 | + | |
688 | 689 | | |
689 | 690 | | |
690 | 691 | | |
| |||
738 | 739 | | |
739 | 740 | | |
740 | 741 | | |
| 742 | + | |
741 | 743 | | |
742 | 744 | | |
743 | 745 | | |
| |||
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
| 153 | + | |
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
162 | 166 | | |
163 | 167 | | |
164 | 168 | | |
| |||
0 commit comments