Commit ed1c874
authored
fix(plugin-ecommerce): priceInput does not respect required field status (#15783)
### What?
The `PriceInput` component in `@payloadcms/plugin-ecommerce` does not
show the required indicator (asterisk) on the field label when the field
is configured with `required: true`.
### Why?
`PriceInput` receives the full `field` object (which includes
`required`), but never passes it down to `FormattedInput`.
`FormattedInput` in turn doesn't accept or forward a `required` prop to
`FieldLabel`.
### How?
- Pass `field.required` from `PriceInput` to `FormattedInput`
- Add `required` to the `FormattedInput` props interface
- Forward `required` to the `FieldLabel` component1 parent 2b23010 commit ed1c874
2 files changed
Lines changed: 4 additions & 1 deletion
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| |||
136 | 138 | | |
137 | 139 | | |
138 | 140 | | |
139 | | - | |
| 141 | + | |
140 | 142 | | |
141 | 143 | | |
142 | 144 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
0 commit comments