wonday / react-native-pdf

A <Pdf /> component for react-native
MIT License
1.58k stars 534 forks source link

add an option for disabling double tap #797

Closed tobyt42 closed 6 months ago

tobyt42 commented 7 months ago

Double tap remains enabled by default but can be optionally disabled.

This is based on a patch that was posted on this issue https://github.com/wonday/react-native-pdf/issues/528, which I've made minor adjustments to whenever I needed to apply it to a newer react-native-pdf version.

Some users of my app have reported that they accidentally activate zoom without double tapping (it seems to be an issue on some devices only), hence I have used this patch to give users the option to disable double-tap zooming. Setting maxScale to 1 as reported on the linked issue, did not help with the issue for me.

joaonew commented 7 months ago

I need this option, can we have it merged???

wonday commented 6 months ago

It is cool, but can you modify the readme file together?

tobyt42 commented 6 months ago

Readme updated

bitcrumb commented 2 months ago

@tobyt42 See my comment here

This change effectively breaks link detection on iOS due to the disabling of the UITapGestureRecognizer. This breaks both internal links (e.g. to a different page) as well as external links.

I currently work around this by disabling enableDoubleTapZoom and applying the following patch: react-native-pdf+6.7.5.patch (although only applying the patch is effective enough).

tobyt42 commented 2 months ago

I would suggest creating a pull request against react-native-pdf

bitcrumb commented 2 months ago

@tobyt42 I've opened an issue.

Since I don't know the exact reasoning behind introducing the enableDoubleTapZoom and why the UITapGestureRecognizer should be disabled for it to work, I can't propose an easy fix.

My patch just comments out the disabling of the tap gesture recognizer & since I don't think I need the enableDoubleTapZoom.