Skip to content

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

TypeScript

Close the finish dialog when an answer is found too long

Claude812780479381
diff --git a/src/components/signing/signing-live-shell.tsx b/src/components/signing/signing-live-shell.tsx
index 0efa437..6d4c435 100644
--- a/src/components/signing/signing-live-shell.tsx
+++ b/src/components/signing/signing-live-shell.tsx
@@ -686,12 +686,23 @@ export function SigningLiveShell({
return;
}
- setTooLongAnswers((current) =>
+ const maxCharacters =
payload.fits === false &&
typeof payload.maxCharacters === "number"
- ? { ...current, [field.id]: payload.maxCharacters }
- : withoutKey(current, field.id),
+ ? payload.maxCharacters
+ : null;
+
+ setTooLongAnswers((current) =>
+ maxCharacters === null
+ ? withoutKey(current, field.id)
+ : { ...current, [field.id]: maxCharacters },
);
+
+ // Opened before the answer was found too long: back to the
+ // page, where the box and the panel say what to shorten.
+ if (maxCharacters !== null) {
+ setIsFinishDialogOpen(false);
+ }
})
.catch(giveUp);
}