You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+32Lines changed: 32 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,38 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
8
8
## [Unreleased]
9
9
10
+
### Added
11
+
12
+
- support into `requiredFields` property of `Form` component, for nested objects and arrays.
13
+
-`form` helper functions
14
+
15
+
### Fixed
16
+
17
+
- Required field label on `FormGroupLayoutLabel`, `ColorPicker`, `TelephoneNumberInput`, `TypeaheadTextField` (hence `StaticTypeaheadInput` and `AsyncTypeaheadInput`) in order to display \* also on nested and array fields.
18
+
19
+
1.`requiredFields` can still accept a `FieldPath<T>[]`
20
+
2. In order to be complaint with `FieldPath` react-hook-form type (`object.${number}.property`) array properties provide a wildcard:
21
+
22
+
```tsx
23
+
requiredFields= [
24
+
`object`,
25
+
`object.nestedObjects`,
26
+
`objects.*.property`,
27
+
`object.nestedObject.property`,
28
+
`object.nestedObjects.*.property`,
29
+
];
30
+
```
31
+
32
+
is going to consider as required:
33
+
34
+
```tsx
35
+
name="object"
36
+
name="object.nestedObjects.0", "object.nestedObjects.1", etc.
37
+
name="objects.0.property", name="objects.1.property", etc.
38
+
name="object.nestedObject.property"
39
+
name="object.nestedObjects.0.property", name="object.nestedObjects.1.property", etc.
0 commit comments