@mxenabled/connect-widget 0.13.4 → 0.13.5
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.
- package/dist/index.es.js +19 -2
- package/dist/index.es.js.map +1 -1
- package/dist/lastBuild.txt +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -81170,6 +81170,7 @@ const ManualAccountForm = React__default.forwardRef(
|
|
|
81170
81170
|
const getNextDelay = getDelay();
|
|
81171
81171
|
const fields = getFormFields(props.accountType);
|
|
81172
81172
|
const formRef = ref;
|
|
81173
|
+
const inputRefs = useRef({});
|
|
81173
81174
|
const {
|
|
81174
81175
|
handleTextInputChange,
|
|
81175
81176
|
handleSubmit,
|
|
@@ -81243,6 +81244,14 @@ const ManualAccountForm = React__default.forwardRef(
|
|
|
81243
81244
|
);
|
|
81244
81245
|
return () => createManualAccount$.unsubscribe();
|
|
81245
81246
|
}, [saving]);
|
|
81247
|
+
useEffect(() => {
|
|
81248
|
+
for (const field of fields) {
|
|
81249
|
+
if (errors[field.name]) {
|
|
81250
|
+
inputRefs.current[field.name]?.focus();
|
|
81251
|
+
break;
|
|
81252
|
+
}
|
|
81253
|
+
}
|
|
81254
|
+
}, [errors]);
|
|
81246
81255
|
const shouldFocus = (field, returnField2, i) => returnField2 ? returnField2 === field : i === 0;
|
|
81247
81256
|
if (props.showDayPicker) {
|
|
81248
81257
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -81321,7 +81330,11 @@ const ManualAccountForm = React__default.forwardRef(
|
|
|
81321
81330
|
fullWidth: true,
|
|
81322
81331
|
helperText: errors[field.name],
|
|
81323
81332
|
id: field.name,
|
|
81324
|
-
inputProps: {
|
|
81333
|
+
inputProps: {
|
|
81334
|
+
"data-test": "date-input",
|
|
81335
|
+
"aria-describedby": errors[field.name] ? field.name + "-error" : void 0
|
|
81336
|
+
},
|
|
81337
|
+
inputRef: (el) => inputRefs.current[field.name] = el,
|
|
81325
81338
|
label: field.label,
|
|
81326
81339
|
name: field.name,
|
|
81327
81340
|
onChange: () => {
|
|
@@ -81358,7 +81371,11 @@ const ManualAccountForm = React__default.forwardRef(
|
|
|
81358
81371
|
fullWidth: true,
|
|
81359
81372
|
helperText: errors[field.name],
|
|
81360
81373
|
id: field.name,
|
|
81361
|
-
inputProps: {
|
|
81374
|
+
inputProps: {
|
|
81375
|
+
"data-test": `text-input-${field.name}`,
|
|
81376
|
+
"aria-describedby": errors[field.name] ? field.name + "-error" : void 0
|
|
81377
|
+
},
|
|
81378
|
+
inputRef: (el) => inputRefs.current[field.name] = el,
|
|
81362
81379
|
label: field.label,
|
|
81363
81380
|
name: field.name,
|
|
81364
81381
|
onChange: handleTextInputChange,
|