@hubsync/esign-web-sdk 6.9.13 → 6.9.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -506,6 +506,7 @@ export class VerdocsSign {
506
506
  }
507
507
  if (e.detail === null) {
508
508
  console.log('[SIGN] Clearing initial');
509
+ this.initialId = null;
509
510
  const updateResult = await updateEnvelopeField(this.endpoint, this.envelopeId, this.roleId, field.name, null, false);
510
511
  return this.updateRecipientFieldValue(field.name, updateResult);
511
512
  }
@@ -551,6 +552,7 @@ export class VerdocsSign {
551
552
  }
552
553
  if (e.detail === null) {
553
554
  console.log('[SIGN] Clearing signature');
555
+ this.signatureId = null;
554
556
  const updateResult = await updateEnvelopeField(this.endpoint, this.envelopeId, this.roleId, field.name, null, false);
555
557
  return this.updateRecipientFieldValue(field.name, updateResult);
556
558
  }
@@ -616,6 +618,20 @@ export class VerdocsSign {
616
618
  async handleNext() {
617
619
  var _a;
618
620
  if (this.nextSubmits) {
621
+ // Re-verify required fields synchronously before submitting. nextSubmits can be stale if
622
+ // a text field was cleared but not yet blurred before the button was clicked — the focusout
623
+ // save is async, so the local value hasn't updated by the time onClick fires.
624
+ const allFields = this.getSortedFillableFields();
625
+ const requiredIncomplete = allFields.some(f => f.required && !this.isFieldActuallyFilled(f));
626
+ if (requiredIncomplete) {
627
+ this.nextSubmits = false;
628
+ this.nextButtonLabel = 'Next';
629
+ const currentField = allFields.find(f => f.name === this.focusedField);
630
+ const next = this.getNextUnfilledField(currentField);
631
+ if (next)
632
+ this.focusFieldElement(next);
633
+ return;
634
+ }
619
635
  try {
620
636
  // Patches the date picker to be forcibly removed if still showing during submission
621
637
  (_a = document.getElementById('air-datepicker-global-container')) === null || _a === void 0 ? void 0 : _a.remove();