-
-
Notifications
You must be signed in to change notification settings - Fork 980
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
Fix Pressables
's interference with other gestures when nested
#3015
Fix Pressables
's interference with other gestures when nested
#3015
Conversation
After further testing, it appears that on |
Doesn't changing |
Also, the title is a bit confusing as it suggests changes to |
It does!
I'll fix the title. |
Swipeable
's interference with nested gesturesPressables
's interference with other gestures when nested
Also, please update PR description 😅 |
Description
LongPress
was found to be using excessively high value for it'sminDuration
andmaxDistance
configs.While
maxDistance
config caused no issues,minDuration
config caused an instantaneous activation.This behaviour stems from
setTimeout
handling values up to2^31-1
whileMAX_SAFE_INTEGER
is much higher than that.This unintended activation blocked some nested gestures underneath the
Pressable
from activating onweb
.By replacing
Number.MAX_SAFE_INTEGER
with2 ** 31 - 1
which represents the largest possible 32-bit integer, those issues were resolved.Found while investigating this issue.
Both issues - the one reported by @milan-digiuseppe-level and the one described in this PR might be related, but it's not immidiately clear as I couldn't replicate the former one.
closes #2863
Test plan
EmptyExample
in both an editor and aweb
browserSwipeables
can be moved by their nestedPressable
, with this fix, all of them can be swipedScreen.Recording.2024-07-29.at.16.58.16.mov
Screen.Recording.2024-07-29.at.17.30.39.mov
Attached code