Closed latekvo closed 3 months ago
After further testing, it appears that on iOS
, when Pressable
is nested inside a native Scroll
, only every second press is registered. I'll address this issue asap.
Doesn't changing LongPress
to Manual
change the behavior on native? I believe we were talking about it and Manual
was causing other gestures to misbehave.
Also, the title is a bit confusing as it suggests changes to Swipeable
component.
Doesn't changing
LongPress
toManual
change the behavior on native? I believe we were talking about it andManual
was causing other gestures to misbehave. - @j-piasecki
It does!
But I found that by adding .manualActivation(true)
to the Manual
gesture, most of those issues can be alleviated. The only one that I have to fix after this change is the one I mentioned in the comment above.
Also, the title is a bit confusing as it suggests changes to Swipeable component.
I'll fix the title.
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 fromsetTimeout
handling values up to2^31-1
whileMAX_SAFE_INTEGER
is much higher than that. This unintended activation blocked some nested gestures underneath thePressable
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 swipedAttached code