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