monkey-front-components 0.0.742 → 0.0.744

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.
@@ -140,6 +140,19 @@ class BaseComponent {
140
140
  }
141
141
  return '';
142
142
  }
143
+ scrollToError() {
144
+ setTimeout(() => {
145
+ const error = document.getElementsByTagName('error');
146
+ let letHEele = null;
147
+ for (let i = 0; i <= error.length; i += 1) {
148
+ if (`${error[i].textContent}`.trim()) {
149
+ letHEele = error[i];
150
+ break;
151
+ }
152
+ }
153
+ letHEele?.scrollIntoView({ behavior: 'smooth', block: 'center' });
154
+ }, 0);
155
+ }
143
156
  validateFormWithTranslate(f, index) {
144
157
  const formErrors = f.value;
145
158
  if (f.status === 'VALID')
@@ -216,6 +229,12 @@ class BaseComponent {
216
229
  };
217
230
  }
218
231
  f.markAllAsTouched();
232
+ try {
233
+ this.scrollToError();
234
+ }
235
+ catch (e) {
236
+ // ignore
237
+ }
219
238
  return false;
220
239
  }
221
240
  clearAllServiceData(clearData) {