wonday / react-native-pdf

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

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

Open frannale opened 3 weeks ago

frannale commented 3 weeks ago

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

dattm97 commented 3 weeks ago

I have the same issue.

HassenMab commented 3 weeks ago

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

tdinckaya commented 3 weeks ago

same issue

lfelipesbs commented 3 weeks ago

same issue

dizzyant commented 2 weeks ago

same issue

scarlac commented 2 weeks ago

Please react to the original issue with 👍 instead of commenting.

scarlac commented 2 weeks ago

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};
  // ...
alex-mironov commented 1 week ago

@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?

Abderrazzek commented 1 week ago

@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 commented 1 week ago

@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.

dizzyant commented 1 week ago

@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?)

aokdev06 commented 1 week ago

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

vishaltanna commented 2 days ago

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.