@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.
@@ -499,7 +499,10 @@ const VerdocsSign = class {
499
499
  console.log('[SIGN] Clearing initial');
500
500
  this.initialId = null;
501
501
  const updateResult = await updateEnvelopeField(this.endpoint, this.envelopeId, this.roleId, field.name, null, false);
502
- return this.updateRecipientFieldValue(field.name, updateResult);
502
+ this.updateRecipientFieldValue(field.name, updateResult);
503
+ if (field.required)
504
+ this.focusFieldElement(field);
505
+ return;
503
506
  }
504
507
  // If we already have an initials block, apply it
505
508
  if (this.initialId) {
@@ -545,7 +548,10 @@ const VerdocsSign = class {
545
548
  console.log('[SIGN] Clearing signature');
546
549
  this.signatureId = null;
547
550
  const updateResult = await updateEnvelopeField(this.endpoint, this.envelopeId, this.roleId, field.name, null, false);
548
- return this.updateRecipientFieldValue(field.name, updateResult);
551
+ this.updateRecipientFieldValue(field.name, updateResult);
552
+ if (field.required)
553
+ this.focusFieldElement(field);
554
+ return;
549
555
  }
550
556
  // If we already have a signature block, apply it
551
557
  if (this.signatureId) {
@@ -706,6 +712,12 @@ const VerdocsSign = class {
706
712
  }
707
713
  }
708
714
  isFieldActuallyFilled(field) {
715
+ var _a;
716
+ // The server keeps value="signed" even after a signature/initial is cleared;
717
+ // settings.signature_id is the authoritative indicator of whether it's actually signed.
718
+ if (field.type === 'signature' || field.type === 'initial') {
719
+ return !!((_a = field.settings) === null || _a === void 0 ? void 0 : _a.signature_id);
720
+ }
709
721
  if (field.type === 'radio' && field.group) {
710
722
  const groupFilled = this.getRecipientFields().some(f => f.group === field.group && f.value === 'true');
711
723
  if (groupFilled) {