use the first value from options as default (#20589)

fixes: #20379
This commit is contained in:
Erik Jan de Wit 2023-05-30 14:02:47 +02:00 committed by GitHub
parent df5a823738
commit 34e56ccd81
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -35,7 +35,7 @@ export const ListComponent = ({
<Controller
name={convertToName(name!)}
data-testid={name}
defaultValue={defaultValue || ""}
defaultValue={defaultValue || options?.[0] || ""}
control={control}
render={({ field }) => (
<Select