codeforlife 2.6.8 → 2.6.9

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [2.6.9](https://github.com/ocadotechnology/codeforlife-package-javascript/compare/v2.6.8...v2.6.9) (2025-02-25)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * rename property ([35827d7](https://github.com/ocadotechnology/codeforlife-package-javascript/commit/35827d7452023f3a1ea8723b6b31fd9b84173cdd))
7
+
1
8
  ## [2.6.8](https://github.com/ocadotechnology/codeforlife-package-javascript/compare/v2.6.7...v2.6.8) (2025-02-24)
2
9
 
3
10
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "codeforlife",
3
3
  "description": "Common frontend code",
4
4
  "private": false,
5
- "version": "2.6.8",
5
+ "version": "2.6.9",
6
6
  "type": "module",
7
7
  "scripts": {
8
8
  "dev": "vite",
@@ -56,14 +56,14 @@ type BaseFormProps<Values> = Omit<FormikConfig<Values>, "children"> & {
56
56
  children: ReactNode | ((props: _FormikProps<Values>) => ReactNode)
57
57
  scrollIntoViewOptions?: ScrollIntoViewOptions
58
58
  nonFieldErrorsProps?: Omit<NonFieldErrorsProps, "children">
59
- order?: Array<{ name: string; inputRef: RefObject<HTMLInputElement> }>
59
+ fieldRefs?: Array<{ name: string; inputRef: RefObject<HTMLInputElement> }>
60
60
  }
61
61
 
62
62
  const BaseForm = <Values extends FormValues>({
63
63
  children,
64
64
  scrollIntoViewOptions = SCROLL_INTO_VIEW_OPTIONS,
65
65
  nonFieldErrorsProps,
66
- order,
66
+ fieldRefs,
67
67
  ...otherFormikProps
68
68
  }: BaseFormProps<Values>) => (
69
69
  <Formik {...otherFormikProps}>
@@ -79,10 +79,10 @@ const BaseForm = <Values extends FormValues>({
79
79
  )
80
80
  }
81
81
  // If a submission was attempted and refs to the fields were provided.
82
- else if (formik.isSubmitting && order && order.length) {
82
+ else if (formik.isSubmitting && fieldRefs && fieldRefs.length) {
83
83
  const errorNames = getKeyPaths(formik.errors)
84
84
 
85
- const inputRef = order.find(({ name }) =>
85
+ const inputRef = fieldRefs.find(({ name }) =>
86
86
  errorNames.includes(name),
87
87
  )?.inputRef
88
88