YanYuanFE / react-native-signature-canvas

:black_nib: React Native Signature Component based WebView Canvas for Android && IOS && expo
MIT License
417 stars 149 forks source link

Only Dots were shown in when drawing signature on Android #333

Open huziidroid opened 10 months ago

huziidroid commented 10 months ago

Hi! πŸ‘‹

Firstly, thanks for your work on this project! πŸ™‚

Today I used patch-package to patch react-native-signature-canvas@4.7.1 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-signature-canvas/index.js b/node_modules/react-native-signature-canvas/index.js
index b30c561..195f1c0 100644
--- a/node_modules/react-native-signature-canvas/index.js
+++ b/node_modules/react-native-signature-canvas/index.js
@@ -263,6 +263,7 @@ const SignatureView = forwardRef(
     return (
       <View style={[styles.webBg, style]}>
         <WebView
+          nestedScrollEnabled={true}
           bounces={false}
           style={[webviewContainerStyle]}
           scrollEnabled={scrollable}

This issue body was partially generated by patch-package.

nicholascm commented 10 months ago

Ran into this exact issue last week - brilliantly simple fix - thanks @huziidroid

ebarahona commented 1 week ago

Ran into this issue as well, after lot's of hours messing with gesture handlers and scrollviews, I also ran into the same solution however I found that the library has a property so you can pass the property rather than patching the package.

` import SignatureView, { SignatureViewRef } from 'react-native-signature-canvas';

...

<SignatureView nestedScrollEnabled={true} // pass the prop ...

`