Glazzes / react-native-zoom-toolkit

Smoothly zoom any image, video or component you want!
https://glazzes.github.io/react-native-zoom-toolkit/
MIT License
184 stars 11 forks source link

[Question]: Suppress Double Tap Zoom #58

Closed josh-platik closed 1 month ago

josh-platik commented 1 month ago

Summary

For the Resumable Zoom Component is there a way for me to enable single taps but disable the double tap zoom functionality?

https://glazzes.github.io/react-native-zoom-toolkit/components/resumablezoom.html#tapsenabled

Thanks for this software, it is fantastic

Glazzes commented 1 month ago

Hi there, at the moment there's no way to disable only one of them, however ResumableZoom received an update not long ago where it can detect touches via onPress events, you could try something like this:

<ResumableZoom tapsEnabled={false}>
  <Pressable onPress={(e) => console.log("press event", e)}>
    <Image source={{uri}} style={{width: 200, height: 200}} />
  </Pressable>
</ResumableZoom>

There's a downside to consider with this solution, the press events are strictly bounded to the child component within the Pressable, therefore extendGestures property set to true would not extend for press events, pinch and pan can be extended as expected.