Skip to content

Commit ac64eec

Browse files
committed
fix(select field): missing default value in select field
* payloadcms/payload#11715
1 parent 373b47e commit ac64eec

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/blocks/Form/Select/index.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,16 @@ export const Select: FunctionComponent<
1818
control: Control;
1919
errors: Partial<FieldErrorsImpl>;
2020
}
21-
> = ({ name, control, errors, label, options, required, width }) => {
21+
> = ({
22+
name,
23+
control,
24+
errors,
25+
label,
26+
options,
27+
required,
28+
width,
29+
defaultValue,
30+
}) => {
2231
return (
2332
<Width width={width}>
2433
<Label htmlFor={name}>
@@ -31,7 +40,7 @@ export const Select: FunctionComponent<
3140
</Label>
3241
<Controller
3342
control={control}
34-
defaultValue=""
43+
defaultValue={defaultValue}
3544
name={name}
3645
render={({ field: { onChange, value } }) => {
3746
const controlledValue = options.find((t) => t.value === value);

0 commit comments

Comments
 (0)