@hubsync/esign-web-sdk 6.5.9 → 6.5.10

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.
@@ -160,8 +160,9 @@ export class VerdocsSign {
160
160
  this.processAuthResponse(response);
161
161
  const fillable = this.getSortedFillableFields();
162
162
  if (fillable.length > 0) {
163
+ // Give the document a moment to render, then focus and highlight the first fillable field
163
164
  setTimeout(() => {
164
- this.focusedField = fillable[0].name;
165
+ this.focusField(fillable[0]);
165
166
  }, 500);
166
167
  }
167
168
  }
@@ -524,12 +525,22 @@ export class VerdocsSign {
524
525
  }
525
526
  focusField(field, scrollInline = 'center') {
526
527
  var _a;
527
- if (!field)
528
+ // Clear any previously highlighted field
529
+ const previousActive = document.querySelector('.verdocs-active-field');
530
+ if (previousActive) {
531
+ previousActive.classList.remove('verdocs-active-field');
532
+ }
533
+ if (!field) {
534
+ this.focusedField = '';
528
535
  return;
536
+ }
529
537
  const id = getFieldId(field);
530
538
  const el = document.getElementById(id);
531
- el === null || el === void 0 ? void 0 : el.scrollIntoView({ behavior: 'smooth', block: 'center', inline: scrollInline });
532
- (_a = el === null || el === void 0 ? void 0 : el.focusField) === null || _a === void 0 ? void 0 : _a.call(el);
539
+ if (el) {
540
+ el.classList.add('verdocs-active-field');
541
+ el.scrollIntoView({ behavior: 'smooth', block: 'center', inline: scrollInline });
542
+ (_a = el.focusField) === null || _a === void 0 ? void 0 : _a.call(el);
543
+ }
533
544
  this.focusedField = field.name;
534
545
  this.markFieldVisited(field.name);
535
546
  this.checkRecipientFields();