@hubsync/esign-web-sdk 6.5.16 → 6.5.17

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.
@@ -444,12 +444,16 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsSign extends
444
444
  console.log('[SIGN] Reusing initial', this.initialId);
445
445
  const updateResult = await updateEnvelopeField(this.endpoint, this.envelopeId, this.roleId, field.name, this.initialId, false);
446
446
  this.updateRecipientFieldValue(field.name, updateResult);
447
- // Auto-focus next field after filling initial
447
+ // Auto-focus next field after filling initial (only if not the last field)
448
448
  setTimeout(() => {
449
449
  const fields = this.getSortedFillableFields();
450
- const nextField = this.getNextFieldFromList(fields);
451
- if (nextField) {
452
- this.focusField(nextField);
450
+ const currentIndex = fields.findIndex(f => f.name === field.name);
451
+ // Only focus next field if current field is not the last one
452
+ if (currentIndex >= 0 && currentIndex < fields.length - 1) {
453
+ const nextField = this.getNextFieldFromList(fields);
454
+ if (nextField && fields.findIndex(f => f.name === nextField.name) > currentIndex) {
455
+ this.focusField(nextField);
456
+ }
453
457
  }
454
458
  }, 100);
455
459
  return;
@@ -460,12 +464,16 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsSign extends
460
464
  const updateResult = await updateEnvelopeField(this.endpoint, this.envelopeId, this.roleId, field.name, e.detail, false);
461
465
  this.initialId = e.detail;
462
466
  this.updateRecipientFieldValue(field.name, updateResult);
463
- // Auto-focus next field after filling initial
467
+ // Auto-focus next field after filling initial (only if not the last field)
464
468
  setTimeout(() => {
465
469
  const fields = this.getSortedFillableFields();
466
- const nextField = this.getNextFieldFromList(fields);
467
- if (nextField) {
468
- this.focusField(nextField);
470
+ const currentIndex = fields.findIndex(f => f.name === field.name);
471
+ // Only focus next field if current field is not the last one
472
+ if (currentIndex >= 0 && currentIndex < fields.length - 1) {
473
+ const nextField = this.getNextFieldFromList(fields);
474
+ if (nextField && fields.findIndex(f => f.name === nextField.name) > currentIndex) {
475
+ this.focusField(nextField);
476
+ }
469
477
  }
470
478
  }, 100);
471
479
  return;
@@ -512,12 +520,16 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsSign extends
512
520
  console.log('[SIGN] Reusing signature', this.signatureId);
513
521
  const updateResult = await updateEnvelopeField(this.endpoint, this.envelopeId, this.roleId, field.name, this.signatureId, false);
514
522
  this.updateRecipientFieldValue(field.name, updateResult);
515
- // Auto-focus next field after filling signature
523
+ // Auto-focus next field after filling signature (only if not the last field)
516
524
  setTimeout(() => {
517
525
  const fields = this.getSortedFillableFields();
518
- const nextField = this.getNextFieldFromList(fields);
519
- if (nextField) {
520
- this.focusField(nextField);
526
+ const currentIndex = fields.findIndex(f => f.name === field.name);
527
+ // Only focus next field if current field is not the last one
528
+ if (currentIndex >= 0 && currentIndex < fields.length - 1) {
529
+ const nextField = this.getNextFieldFromList(fields);
530
+ if (nextField && fields.findIndex(f => f.name === nextField.name) > currentIndex) {
531
+ this.focusField(nextField);
532
+ }
521
533
  }
522
534
  }, 100);
523
535
  return;
@@ -528,12 +540,16 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsSign extends
528
540
  const updateResult = await updateEnvelopeField(this.endpoint, this.envelopeId, this.roleId, field.name, e.detail, false);
529
541
  this.signatureId = e.detail;
530
542
  this.updateRecipientFieldValue(field.name, updateResult);
531
- // Auto-focus next field after filling signature
543
+ // Auto-focus next field after filling signature (only if not the last field)
532
544
  setTimeout(() => {
533
545
  const fields = this.getSortedFillableFields();
534
- const nextField = this.getNextFieldFromList(fields);
535
- if (nextField) {
536
- this.focusField(nextField);
546
+ const currentIndex = fields.findIndex(f => f.name === field.name);
547
+ // Only focus next field if current field is not the last one
548
+ if (currentIndex >= 0 && currentIndex < fields.length - 1) {
549
+ const nextField = this.getNextFieldFromList(fields);
550
+ if (nextField && fields.findIndex(f => f.name === nextField.name) > currentIndex) {
551
+ this.focusField(nextField);
552
+ }
537
553
  }
538
554
  }, 100);
539
555
  return;
@@ -566,12 +582,16 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsSign extends
566
582
  const { formattedDate } = e.detail;
567
583
  if (formattedDate) {
568
584
  return this.saveFieldChange(field.name, formattedDate, false).then(() => {
569
- // Auto-focus next field after filling date
585
+ // Auto-focus next field after filling date (only if not the last field)
570
586
  setTimeout(() => {
571
587
  const fields = this.getSortedFillableFields();
572
- const nextField = this.getNextFieldFromList(fields);
573
- if (nextField) {
574
- this.focusField(nextField);
588
+ const currentIndex = fields.findIndex(f => f.name === field.name);
589
+ // Only focus next field if current field is not the last one
590
+ if (currentIndex >= 0 && currentIndex < fields.length - 1) {
591
+ const nextField = this.getNextFieldFromList(fields);
592
+ if (nextField && fields.findIndex(f => f.name === nextField.name) > currentIndex) {
593
+ this.focusField(nextField);
594
+ }
575
595
  }
576
596
  }, 100);
577
597
  });