Pan gesture allows for use of activateAfterLongPress modifier, which allows it to be activated after holding down the gesture down for a specified amount of time.
This modifier uses setTimeout underneath, which was not properly cleared when the gesture was disabled while being pressed down.
Closes: #3074
Test plan
run the attached code
when the button is clicked 2 times, nothing happens
without this PR, clicking the button 2 times results in onStart firing on the Pan gesture due to lack of timeout clearing
Attached code
make sure to have @shopify/flash-list installed
Collapsed code
Description
Pan
gesture allows for use ofactivateAfterLongPress
modifier, which allows it to be activated after holding down the gesture down for a specified amount of time.This modifier uses
setTimeout
underneath, which was not properly cleared when the gesture was disabled while being pressed down.Closes: #3074
Test plan
onStart
firing on thePan
gesture due to lack oftimeout
clearingAttached code
@shopify/flash-list
installedCollapsed code
Results
Collapsed results recordings
### Before https://github.com/user-attachments/assets/c09b2bc4-8b6a-4f2b-aa8c-efa78821d7f2 ### Fixed https://github.com/user-attachments/assets/5a72a363-94d4-4fdb-9060-f0f496487614Important:
As far as I see, all the other calls to
this.clearActivationTimeout()
can be activated individually, and none of them are redundant.