-
-
Notifications
You must be signed in to change notification settings - Fork 988
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cancel failed buttons in reset #3350
base: main
Are you sure you want to change the base?
Conversation
Hey, thank you for the PR! Could you please provide a repro where #2160 still occurs? I tried reproducing this issue with |
Hi I made a minimal reproduction here: https://snack.expo.dev/@oblador/gesture-handler-list-reproduction Note that this is Android only, see a video of the reproduction where you can notice that before I scroll the first list item responds with a highlight, but afterwards none do: screen-20250122-131111.mp4 |
For what it's worth, I've managed to get into this state even without |
I also rendomly experience when in a ScrollView there are two buttons and the second one ( (it's FAB) overlaps the first one. Sometimes pressing a FAB buttons also triggers the underlying button (the ripple animation starts). FAB triggers navigation. Then the app becomes unresponsive to This PR might help with that too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, I tested your solution on your repro, and I still managed to get the RectButton
s stuck in the active state.
It looks like this issue is caused by NativeViewGestureHandler
either never leaving the ACTIVE
state, or being removed from gestureHandlers
array before being reset or finished.
When i managed to get RectButton
stuck, onCancel
, onFail
and onReset
were never called, suggesting NativeViewGestureHandler
was never finished
in the first place (onFail
doesn't exist on main, added it for debugging).
I've also tried different approaches, but haven't solved this issue yet.
I'll dig into this deeper, and keep you updated when I find any solution.
@RohovDmytro I think your issue is a different one from this, but I came across it today as well, and created a separate issue for it here: #3370 This PR doesn't solve that bug however. |
Description
This PR is an attempt at fixing bug reported in #2160.
Essentially when having a button with
shouldCancelWhenOutside={true}
in aScrollView
and scrolling quickly, especially when at the bottom where the scrollview exhibit rubber band effect, all buttons becomes unresponsive. This is becausetouchResponder
is never freed after it goes intoFAILED
state, which typically otherwise happens whenACTION_UP
is emitted – something that never happens.I'm not sure of the ideal solution, but I'd figured I share my half-baked workaround to emit
CANCEL
inonReset
if the button is stuck inFAILED
. Curious to hear suggestions on how to improve this.Test plan