@hubsync/esign-web-sdk 6.9.13 → 6.9.14

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.
@@ -481,6 +481,7 @@ const VerdocsSign = class {
481
481
  }
482
482
  if (e.detail === null) {
483
483
  console.log('[SIGN] Clearing initial');
484
+ this.initialId = null;
484
485
  const updateResult = await updateEnvelopeField(this.endpoint, this.envelopeId, this.roleId, field.name, null, false);
485
486
  return this.updateRecipientFieldValue(field.name, updateResult);
486
487
  }
@@ -526,6 +527,7 @@ const VerdocsSign = class {
526
527
  }
527
528
  if (e.detail === null) {
528
529
  console.log('[SIGN] Clearing signature');
530
+ this.signatureId = null;
529
531
  const updateResult = await updateEnvelopeField(this.endpoint, this.envelopeId, this.roleId, field.name, null, false);
530
532
  return this.updateRecipientFieldValue(field.name, updateResult);
531
533
  }
@@ -591,6 +593,20 @@ const VerdocsSign = class {
591
593
  async handleNext() {
592
594
  var _a;
593
595
  if (this.nextSubmits) {
596
+ // Re-verify required fields synchronously before submitting. nextSubmits can be stale if
597
+ // a text field was cleared but not yet blurred before the button was clicked — the focusout
598
+ // save is async, so the local value hasn't updated by the time onClick fires.
599
+ const allFields = this.getSortedFillableFields();
600
+ const requiredIncomplete = allFields.some(f => f.required && !this.isFieldActuallyFilled(f));
601
+ if (requiredIncomplete) {
602
+ this.nextSubmits = false;
603
+ this.nextButtonLabel = 'Next';
604
+ const currentField = allFields.find(f => f.name === this.focusedField);
605
+ const next = this.getNextUnfilledField(currentField);
606
+ if (next)
607
+ this.focusFieldElement(next);
608
+ return;
609
+ }
594
610
  try {
595
611
  // Patches the date picker to be forcibly removed if still showing during submission
596
612
  (_a = document.getElementById('air-datepicker-global-container')) === null || _a === void 0 ? void 0 : _a.remove();