Open talhauzair-28 opened 2 years ago
Waiting for a response.
Sorry, there has never been a better way to use SignatureScreen and ScrollView together. I'm not very familiar with react native, and I don't have much time to dig into this problem. You are very welcome to read our source code to find the cause of the problem, and welcome to send PR。
just add this prop nestedScrollEnabled={false} - inside the SignatureScreen component
Objective: I am trying to use
SignatureScreen
fromreact-native-signature-canvas
inside aScrollView
. But whenever I try to scroll up and down. ScrollView takes the gesture and moves the screen instead of focusing on SignatureScreen.I found the solution of using
PanResponder
as a wrapper onSignatureScreen
to avoid the parent view getting the gesture event.Following is the Pandresponder code:
Following is the render code:
This solution was working perfectly on
iOS
as theScrollView
did not get any gesture while drawing onSignatureScreen
. However, onAndroid
,SignatureScreen
was also not getting the gesture. While the expected behaviour on android was like iOS, thatSignatureScreen
gets gesture and not theScrollView
while drawing.Here is what I found:
onStartShouldSetPanResponderCapture
andonMoveShouldSetPanResponderCapture
should returnfalse
, if we want the child to listen to gestures.and we should use
event.stopPropagation()
and set theonPanResponderTerminationRequest
to returnfalse
to stop the gesture event to propagate to the parent view. So here is what my updated code looks like:But the issue is still the same, on Android phones, the child component is not getting the gesture. It only draws a single dot and that's it.
Any help would be appreciated.