@hubsync/esign-web-sdk 6.9.29 → 6.9.31

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.
@@ -476,7 +476,14 @@ const VerdocsSign = class {
476
476
  // TODO: Remove legacy type when no longer needed
477
477
  case 'textarea':
478
478
  case 'textbox':
479
- return this.saveFieldChange(field.name, value, false);
479
+ return this.saveFieldChange(field.name, value, false).then(() => {
480
+ // Advance to the next unfilled field once a value is actually entered, matching the
481
+ // signature/initial/date behavior. Guard on a non-empty value so a stray focusout on an
482
+ // empty/cleared field (e.g. tabbing through or skipping) doesn't yank focus away.
483
+ if (value) {
484
+ this.focusNextFieldAfter(field);
485
+ }
486
+ });
480
487
  case 'checkbox': {
481
488
  return this.saveFieldChange(field.name, String(e.target.checked), false);
482
489
  }
@@ -486,7 +493,14 @@ const VerdocsSign = class {
486
493
  case 'dropdown':
487
494
  // TODO: Set prepared to false server-side.
488
495
  console.log('Saving dropdown', field.name, e.detail);
489
- return this.saveFieldChange(field.name, e.detail, false);
496
+ return this.saveFieldChange(field.name, e.detail, false).then(() => {
497
+ // Advance to the next unfilled field once a selection is made, matching the
498
+ // signature/initial/date/textbox behavior. Guard on a value so clearing the
499
+ // selection doesn't yank focus away.
500
+ if (e.detail) {
501
+ this.focusNextFieldAfter(field);
502
+ }
503
+ });
490
504
  case 'initial':
491
505
  // This can be caused by a focus-out event if the user clicks the field
492
506
  // after it's already filled in, then clicks something else like a textbox.