@hubsync/esign-web-sdk 6.9.20 → 6.9.21

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.
@@ -388,8 +388,10 @@ const VerdocsSign = class {
388
388
  utils.updateDocumentFieldValue(oldField);
389
389
  this.fieldUpdateCounter++;
390
390
  this.markEnvelopeStarted();
391
- // If a previously skipped field gets filled, remove it from the skipped list
392
- if (this.skippedFields.includes(fieldName)) {
391
+ // Only unmark as skipped when the field is actually filled with a real value.
392
+ // An empty-string save (e.g. focusout when navigating away from a skipped textbox)
393
+ // must not remove the field from skippedFields or the skip loop re-triggers.
394
+ if (this.skippedFields.includes(fieldName) && this.isFieldActuallyFilled(oldField)) {
393
395
  this.skippedFields = this.skippedFields.filter(n => n !== fieldName);
394
396
  }
395
397
  this.checkRecipientFields();
@@ -419,6 +421,12 @@ const VerdocsSign = class {
419
421
  if (field === null || field === void 0 ? void 0 : field.readonly) {
420
422
  return Promise.resolve();
421
423
  }
424
+ // Don't persist focusout-triggered saves for skipped fields — navigating away from
425
+ // a skipped textbox fires focusout with an empty value which would cause a pointless
426
+ // API call and trigger the skip loop via updateRecipientFieldValue.
427
+ if (this.skippedFields.includes(fieldName)) {
428
+ return Promise.resolve();
429
+ }
422
430
  console.log('[SIGN] saveFieldChange', fieldName, { value, prepared });
423
431
  return jsSdk.updateEnvelopeField(this.endpoint, this.envelopeId, this.roleId, fieldName, value, prepared)
424
432
  .then(updateResult => this.updateRecipientFieldValue(fieldName, updateResult))