@mxenabled/connect-widget 0.13.4 → 0.13.6

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 CHANGED
@@ -79580,7 +79580,9 @@ const ComeBack = ({ microdeposit, onDone }) => {
79580
79580
  "data-test": "done-button",
79581
79581
  fullWidth: true,
79582
79582
  onClick: () => {
79583
- postMessageFunctions.onPostMessage("connect/microdeposits/comeBack/primaryAction");
79583
+ postMessageFunctions.onPostMessage("connect/microdeposits/comeBack/primaryAction", {
79584
+ microdeposit_guid: microdeposit.guid
79585
+ });
79584
79586
  postMessageFunctions.onPostMessage(POST_MESSAGES.BACK_TO_SEARCH);
79585
79587
  return fadeOut(containerRef.current, "up", 300).then(() => onDone());
79586
79588
  },
@@ -81170,6 +81172,7 @@ const ManualAccountForm = React__default.forwardRef(
81170
81172
  const getNextDelay = getDelay();
81171
81173
  const fields = getFormFields(props.accountType);
81172
81174
  const formRef = ref;
81175
+ const inputRefs = useRef({});
81173
81176
  const {
81174
81177
  handleTextInputChange,
81175
81178
  handleSubmit,
@@ -81243,6 +81246,14 @@ const ManualAccountForm = React__default.forwardRef(
81243
81246
  );
81244
81247
  return () => createManualAccount$.unsubscribe();
81245
81248
  }, [saving]);
81249
+ useEffect(() => {
81250
+ for (const field of fields) {
81251
+ if (errors[field.name]) {
81252
+ inputRefs.current[field.name]?.focus();
81253
+ break;
81254
+ }
81255
+ }
81256
+ }, [errors]);
81246
81257
  const shouldFocus = (field, returnField2, i) => returnField2 ? returnField2 === field : i === 0;
81247
81258
  if (props.showDayPicker) {
81248
81259
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -81321,7 +81332,11 @@ const ManualAccountForm = React__default.forwardRef(
81321
81332
  fullWidth: true,
81322
81333
  helperText: errors[field.name],
81323
81334
  id: field.name,
81324
- inputProps: { "data-test": "date-input" },
81335
+ inputProps: {
81336
+ "data-test": "date-input",
81337
+ "aria-describedby": errors[field.name] ? field.name + "-error" : void 0
81338
+ },
81339
+ inputRef: (el) => inputRefs.current[field.name] = el,
81325
81340
  label: field.label,
81326
81341
  name: field.name,
81327
81342
  onChange: () => {
@@ -81358,7 +81373,11 @@ const ManualAccountForm = React__default.forwardRef(
81358
81373
  fullWidth: true,
81359
81374
  helperText: errors[field.name],
81360
81375
  id: field.name,
81361
- inputProps: { "data-test": `text-input-${field.name}` },
81376
+ inputProps: {
81377
+ "data-test": `text-input-${field.name}`,
81378
+ "aria-describedby": errors[field.name] ? field.name + "-error" : void 0
81379
+ },
81380
+ inputRef: (el) => inputRefs.current[field.name] = el,
81362
81381
  label: field.label,
81363
81382
  name: field.name,
81364
81383
  onChange: handleTextInputChange,