wonday/react-native-pdf

No member named 'enableDoubleTapZoom' in 'facebook::react::RNPDFPdfViewProps'

frannale opened this issue ยท 18 comments

What react-native version are you using? 0.76.1

What react-native-pdf version are you using? 6.75

What platform does your issue occur on? ios

Describe your issue as precisely as possible :

  1. Build IOS
Screenshot 2024-10-30 at 17 57 23

In migration process to RN 0.76.1 this brokes, works ok in RN 0.73.9

I have the same issue.

I'm facing the same issue RN "0.76.1"
works fine on RN "0.75.3"

same issue

same issue

same issue

Please react to the original issue with ๐Ÿ‘ instead of commenting.

As a temporary workaround, or with a patch-package fix, you may change the following line in:
node_modules/react-native-pdf/fabric/RNPDFPdfNativeComponent.js

   // ...
   enableAntialiasing: ?boolean,
   enableDoubleTapZoom: ?boolean, // add this line
   fitPolicy: ?Int32,
   // ...

Then re-run pod install to re-run the code generation. After this, you can confirm the new property was generated by inspecting the file: ios/build/generated/ios/react/renderer/components/rnpdf/Props.h which should now contain:

  // ...
  bool enableAntialiasing{false};
  bool enableDoubleTapZoom{false}; // this will now have been added if the codegen works
  int fitPolicy{0};
  // ...

@scarlac sorry for being inpatient, but do you by chance know when can we expect the new version of package to be released with this fix?

@scarlac Double-clicking on the PDF viewer in iOS causes the app to crash. It seems that additional fixes may be needed to apply a proper patch to the package.

@scarlac sorry for being inpatient, but do you by chance know when can we expect the new version of package to be released with this fix?

Sorry, I'm not the maintainer of this repo, so I don't know.

I had other issues while migrating so I eventually gave up, so it's possible my patch isn't sufficient, as some are indicating.

@scarlac Double-clicking on the PDF viewer in iOS causes the app to crash. It seems that additional fixes may be needed to apply a proper patch to the package.

Commenting out line 735 in node_modules/react-native-pdf/ios/RNPDFPdf/RNPDFPdfView.mm fixed the double tap issue for me on iOS:
_onChange(@{ @"message": @"pageDoubleTap" });
to
// _onChange(@{ @"message": @"pageDoubleTap" });

This gives you the added "feature" of selecting text by a tap followed immediately by a drag. (Maybe it was already like that?)

As a temporary workaround, or with a patch-package fix, you may change the following line in: node_modules/react-native-pdf/fabric/RNPDFPdfNativeComponent.js

   // ...
   enableAntialiasing: ?boolean,
   enableDoubleTapZoom: ?boolean, // add this line
   fitPolicy: ?Int32,
   // ...

Then re-run pod install to re-run the code generation. After this, you can confirm the new property was generated by inspecting the file: ios/build/generated/ios/react/renderer/components/rnpdf/Props.h which should now contain:

  // ...
  bool enableAntialiasing{false};
  bool enableDoubleTapZoom{false}; // this will now have been added if the codegen works
  int fitPolicy{0};
  // ...

Created pull request for fix

As a temporary workaround, or with a patch-package fix, you may change the following line in: node_modules/react-native-pdf/fabric/RNPDFPdfNativeComponent.js

   // ...
   enableAntialiasing: ?boolean,
   enableDoubleTapZoom: ?boolean, // add this line
   fitPolicy: ?Int32,
   // ...

Then re-run pod install to re-run the code generation. After this, you can confirm the new property was generated by inspecting the file: ios/build/generated/ios/react/renderer/components/rnpdf/Props.h which should now contain:

  // ...
  bool enableAntialiasing{false};
  bool enableDoubleTapZoom{false}; // this will now have been added if the codegen works
  int fitPolicy{0};
  // ...

it's worked for me.

Is the MR getting merged anytime soon?

@scarlac Double-clicking on the PDF viewer in iOS causes the app to crash. It seems that additional fixes may be needed to apply a proper patch to the package.

Commenting out line 735 in node_modules/react-native-pdf/ios/RNPDFPdf/RNPDFPdfView.mm fixed the double tap issue for me on iOS: _onChange(@{ @"message": @"pageDoubleTap" }); to // _onChange(@{ @"message": @"pageDoubleTap" });

This gives you the added "feature" of selecting text by a tap followed immediately by a drag. (Maybe it was already like that?)

Thanks @dizzyant this worked for me, my app was crashing on the double tap on the pdf and this fixed it additionally i deleted the app from the emulator and re run pod install.

As a temporary workaround, or with a patch-package fix, you may change the following line in: node_modules/react-native-pdf/fabric/RNPDFPdfNativeComponent.js

   // ...
   enableAntialiasing: ?boolean,
   enableDoubleTapZoom: ?boolean, // add this line
   fitPolicy: ?Int32,
   // ...

Then re-run pod install to re-run the code generation. After this, you can confirm the new property was generated by inspecting the file: ios/build/generated/ios/react/renderer/components/rnpdf/Props.h which should now contain:

  // ...
  bool enableAntialiasing{false};
  bool enableDoubleTapZoom{false}; // this will now have been added if the codegen works
  int fitPolicy{0};
  // ...

Thanks bro, it worked, before doing your fix my app on ios was crashing.

@scarlac Double-clicking on the PDF viewer in iOS causes the app to crash. It seems that additional fixes may be needed to apply a proper patch to the package.

facing the same issue, none of the above workarounds are working