How to reconcile competing gestures (swipe vs tap) inside TikTok style slider? #3537
Unanswered
TowhidKashem
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi friends,
I am hoping someone knows the solution to this issue cause nothing I tried worked so far. I am building a fullscreen slider using a flashlist with width and height 100% (this happens with other list components too, for example I tried flatlist and legendlist as well). The user can swipe this slider to go from item to item and when they find something they like, they can tap the item to go to another screen. So this works pretty much like the TikTok video feed, except it also functions as a nav button at the same time when pressed.
Because of this dual purpose I am running into responsiveness issues. The app waits until a flashlist screen's animation is fully into view and completed before it responds to the tap gesture. And this doesn't feel responsive AT ALL. In fact most of the time I need to tap twice for the tap gesture to take me to the new screen.
I think tiktok solves this by making the slide animation very quick. So by the time the user presses the item the animation is fully completed and the tap can take place uninterrupted.
But no matter what values I try for props like
decelerationRate
to speed the animation up, the speed maxes out to a rate thats still way too slow compared to tik tok's, I don't know why but there is a annoying limitation here.Does anyone know how I can either:
1). get the speed of the flashlist swiper to be extremely fast (like tiktok feed's speed)?
or
2). get the tap gesture to be triggered as soon as the tap takes place even if the swiper's animation is in transit?
Code:
Many thanks!
Beta Was this translation helpful? Give feedback.
All reactions