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