Skip to content

Open-source document signature platform. Not affiliated with DocuSign.

TypeScript

Show the drawing that will be applied after switching signature tabs

njarrardcdca225ee3f
diff --git a/src/components/signing/signing-live-shell.tsx b/src/components/signing/signing-live-shell.tsx
index fd488a4..49aef2d 100644
--- a/src/components/signing/signing-live-shell.tsx
+++ b/src/components/signing/signing-live-shell.tsx
@@ -1896,12 +1896,9 @@ function SignatureModal({
<div className="well p-3">
<SignatureDrawCanvas
emptyMessage={drawPreviewMessage}
- initialDataUrl={
- drawnSignatureVersion === 0 &&
- existingEntry?.inputMethod === "drawn"
- ? (existingEntry.imageDataUrl ?? null)
- : null
- }
+ // The canvas unmounts while the Type tab is shown, so it is seeded
+ // from the drawing that Apply would use, never a stale one.
+ initialDataUrl={drawnSignatureDataUrl}
key={drawnSignatureVersion}
onChange={setDrawnSignatureDataUrl}
/>