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