Expose underlying events from signature_pad
See original GitHub issueExposing the underlying events of signature_pad
would be very useful as it allows to react to signature inputs instead of polling the data of signature_pad
.
This would allow a pattern like:
const [signature, setSignature] = useState("")
...
<SignaturePad ... onEnd={x=> setSignature(x.toDataURL())} />
or add the events to the options, as they are “low level” events, like
<SignaturePad ... options={{
onEnd(x) { setSignature(x.toDataURL()) }
}} />
This allows the rest of the code to react to the value of signature
easily (e.g. disable the save button and display a message if no signation was made…).
Or alternatively expose the whole underying signature_pad
object.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Exposing the SignaturePad Events in PDFViewer - Syncfusion
Is there a way to access the event that is triggered when the user presses "Done" on the signature pad dialog in the...
Read more >Signature pad for HR - Product Documentation | ServiceNow
The HR Service Delivery application uses signature pad with onboarding documents like offer letters, background check approval, company policy acknowledgements, ...
Read more >Draw and Save Signatures in Xamarin.Forms applications
The SignaturePad exposes StrokeStarted event to determine when a new stroke is started and StrokeCompleted event when the stroke is ...
Read more >Using the Signature Pad jQuery Plugin with SharePoint ...
Signature Pad : A jQuery plugin for assisting in the creation of an HTML5 canvas based signature pad. Records the drawn signature in...
Read more >Need help with custom form control - validation and ngModel
I'm trying to build a form with a signature pad as one of the items. ... The biggest problem you have is that...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You are right. The following will work:
If someone is having trouble accessing the underlying instance and registering the event with the hooks API here is the working TS code:
More info of why this is quite tricky can be found here or here.