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

fixes: #20379

Co-authored-by: Stian Thorgersen <stianst@gmail.com>
This commit is contained in:
Erik Jan de Wit 2023-06-01 10:52:46 +02:00 committed by GitHub
parent c84fcbfff9
commit 5967c71bf7
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