@hubsync/esign-web-sdk 6.9.21 → 6.9.22

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.
@@ -525,7 +525,10 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsSign extends
525
525
  console.log('[SIGN] Clearing initial');
526
526
  this.initialId = null;
527
527
  const updateResult = await updateEnvelopeField(this.endpoint, this.envelopeId, this.roleId, field.name, null, false);
528
- return this.updateRecipientFieldValue(field.name, updateResult);
528
+ this.updateRecipientFieldValue(field.name, updateResult);
529
+ if (field.required)
530
+ this.focusFieldElement(field);
531
+ return;
529
532
  }
530
533
  // If we already have an initials block, apply it
531
534
  if (this.initialId) {
@@ -571,7 +574,10 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsSign extends
571
574
  console.log('[SIGN] Clearing signature');
572
575
  this.signatureId = null;
573
576
  const updateResult = await updateEnvelopeField(this.endpoint, this.envelopeId, this.roleId, field.name, null, false);
574
- return this.updateRecipientFieldValue(field.name, updateResult);
577
+ this.updateRecipientFieldValue(field.name, updateResult);
578
+ if (field.required)
579
+ this.focusFieldElement(field);
580
+ return;
575
581
  }
576
582
  // If we already have a signature block, apply it
577
583
  if (this.signatureId) {
@@ -732,6 +738,12 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsSign extends
732
738
  }
733
739
  }
734
740
  isFieldActuallyFilled(field) {
741
+ var _a;
742
+ // The server keeps value="signed" even after a signature/initial is cleared;
743
+ // settings.signature_id is the authoritative indicator of whether it's actually signed.
744
+ if (field.type === 'signature' || field.type === 'initial') {
745
+ return !!((_a = field.settings) === null || _a === void 0 ? void 0 : _a.signature_id);
746
+ }
735
747
  if (field.type === 'radio' && field.group) {
736
748
  const groupFilled = this.getRecipientFields().some(f => f.group === field.group && f.value === 'true');
737
749
  if (groupFilled) {