Closed ultrox closed 6 years ago
@ultrox the onEnd
and onBegin
hooks are _signaturepad specific options. Hence, you need to specify them as part of the options property instead of having them as a direct property of the SignaturePad
component. So this should do what you'd expect:
function handleOnEnd() {
console.log('never fire')
}
...
<SignaturePad
ref={ref => (this.signaturePad = ref)}
options={{onEnd: handleOnEnd}} />
@michaeldzjap I though this might be it, but I end up assigning onEnd to instnace directly in lifecycle method, but I like your solution much better. Thanks Michael!
@michaeldzjap : I am calling the onEnd handler from within the options like this:
But for some reason its not getting triggered. I am using "react-signature-pad-wrapper": "^3.3.1"
@shahriarhossain onEnd
no longer exists in v4 of signature pad. See #36 and this.
I was trying to trigger some behaviour by passing function to onEnd hook, this hook dont want to fire. Am I doing something wrong?
Basically I was trying to save the data to a state after user ends writing on the canvas.