Replies: 3 comments 2 replies
-
|
Hi @grego5! Thank you for your feedback!
Is this the setup that you mean? ...
<GestureDetector gesture={tap}>
<View style={{ width: 200, height: 200, backgroundColor: 'red' }}>
<Touchable
style={{ width: 100, height: 100, backgroundColor: 'blue' }}
onPress={() => {
console.log('pressed');
}}
/>
</View>
</GestureDetector>
...
I don't think they should work simultaneously, though I have to say that in case of iOS Also, could you share some examples that you think behave inconsistently? You've mentioned few, but example code would be great. Once again, thank you for providing feedback for beta! |
Beta Was this translation helpful? Give feedback.
-
|
i found that simply setting disallowInteruption prop on touchable to false solves all my awkward android and ios interactions with scrolllists, long presses, and swipables. well, there's also ios quirk where you need to this my base for all buttons. though need to cleanup these accessibility prop reassignments. const TouchableRipple = forwardRef<ComponentRef<typeof Touchable>, TouchableRippleProps>(
(props, ref) => {
const {
children,
disabled,
disallowInterruption = false,
accessibilityLabel,
accessibilityHint,
accessibilityRole = 'button',
accessibilityState,
rippleColor,
androidRipple,
activeUnderlayOpacity,
underlayColor,
style,
...rest
} = props;
...
return (
<Touchable
ref={ref}
accessible
accessibilityRole={accessibilityRole}
accessibilityLabel={accessibilityLabel}
accessibilityHint={accessibilityHint}
accessibilityState={accessibilityState ? { ...accessibilityState, disabled } : { disabled }}
disabled={disabled}
pointerEvents={disabled ? 'none' : 'box-only'}
//@ts-ignore
disallowInterruption={disallowInterruption}
androidRipple={interactionColors.androidRipple}
activeUnderlayOpacity={
activeUnderlayOpacity ?? (Platform.OS === 'ios' ? IOS_ACTIVE_UNDERLAY_OPACITY : undefined)
}
underlayColor={Platform.OS === 'ios' ? interactionColors.iosUnderlayColor : underlayColor}
{...rest}
style={style}
>
{children}
</Touchable>
); |
Beta Was this translation helpful? Give feedback.
-
We've done some changes to |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
No issues on android, then after testing the app on ios I had to press 10 times until something is activated.
I wrapped Pressable at first for most of my touch interaction needs with android ripple, then changed it to the new Touchable since it's the same thing but probably the new and most maintained component in the beta, so it has to be perfect.. Well, same thing.
It seems happens specifically when the Touchable is inside a parent that also has tap gesture detector. It's like they don't work simultaneously by default on ios.
For example bottom sheet that has swippable body using pan gesture detector, then buttons based on rngh primitives don't work inside. Though this one I can also guard with activeOffsetX/Y, since I don't need taps.
Or tap gesture wrapper to keyboard dismiss when clicking outside will intercept and block everything on ios.
It's like the gesture detection works bottom up on android and top down on ios? Very convenient for cross platform development, what can I say...
This works though...
Also found cancelsTouchesInView: false option on parent gestures disable this unintuitive confusing IOS quirk.
Beta Was this translation helpful? Give feedback.
All reactions