Open sbingram opened 4 months ago
Hey @sbingram you should be able to call $(signaturePadElement).signaturePad().regenerate(drawnSignature)
in order to get the signature to redraw.
Yes @mockdeep that's what I'm doing and it works, but only on the first modal open. After that, the entire div with the signature pad is locked and doesn't either allow for a new signature or display a signature. It's like it's in some indeterminate state and will no longer function. I've seen mention of problems with rebinding the events when editing the DOM, but since all that code exists in a separate script, I'm not sure how I could make that happen.
@sbingram I'm not aware of anything in SignaturePad that would cause this sort of issue. Can you provide code that demonstrates the issue?
Sure. Here's the HTML from the modal: `
Sorry @mockdeep, I just now noticed that the HTML code didn't come through here. I have corrected that now so you can see.
So I setup signature pad inside of a modal window inside a form. Form elements are loaded via jQuery from a key value each time the modal opens. I'm dynamically loading either the drawOnly or displayOnly div based on whether the form has been previously signed or not. Everything works perfectly the first time the modal is opened, however, any subsequent load fails with the canvas not properly reactivated for drawing input. This even occurs if the same unsigned modal is opened after not signing the form. I'm guessing this has something to do with the canvas element not performing well inside of a modal window. I've tried triggering the clear button (and pushing it manually for that matter) without any success. Obviously a complete page load resolves the issue, but is there a way to reset the signature pad function to eliminate the issue or am I just missing something in the application of this code?