@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.
@@ -507,6 +507,7 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsSign extends
507
507
  }
508
508
  if (e.detail === null) {
509
509
  console.log('[SIGN] Clearing initial');
510
+ this.initialId = null;
510
511
  const updateResult = await updateEnvelopeField(this.endpoint, this.envelopeId, this.roleId, field.name, null, false);
511
512
  return this.updateRecipientFieldValue(field.name, updateResult);
512
513
  }
@@ -552,6 +553,7 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsSign extends
552
553
  }
553
554
  if (e.detail === null) {
554
555
  console.log('[SIGN] Clearing signature');
556
+ this.signatureId = null;
555
557
  const updateResult = await updateEnvelopeField(this.endpoint, this.envelopeId, this.roleId, field.name, null, false);
556
558
  return this.updateRecipientFieldValue(field.name, updateResult);
557
559
  }
@@ -617,6 +619,20 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsSign extends
617
619
  async handleNext() {
618
620
  var _a;
619
621
  if (this.nextSubmits) {
622
+ // Re-verify required fields synchronously before submitting. nextSubmits can be stale if
623
+ // a text field was cleared but not yet blurred before the button was clicked — the focusout
624
+ // save is async, so the local value hasn't updated by the time onClick fires.
625
+ const allFields = this.getSortedFillableFields();
626
+ const requiredIncomplete = allFields.some(f => f.required && !this.isFieldActuallyFilled(f));
627
+ if (requiredIncomplete) {
628
+ this.nextSubmits = false;
629
+ this.nextButtonLabel = 'Next';
630
+ const currentField = allFields.find(f => f.name === this.focusedField);
631
+ const next = this.getNextUnfilledField(currentField);
632
+ if (next)
633
+ this.focusFieldElement(next);
634
+ return;
635
+ }
620
636
  try {
621
637
  // Patches the date picker to be forcibly removed if still showing during submission
622
638
  (_a = document.getElementById('air-datepicker-global-container')) === null || _a === void 0 ? void 0 : _a.remove();