Fix options not set when default value is used

pull/6560/head
Hariom Balhara 2023-02-15 21:28:03 +05:30
parent 8e82cb556b
commit 197ee90eda
1 changed files with 12 additions and 10 deletions

View File

@ -158,16 +158,18 @@ export const FormBuilder = function FormBuilder({
readOnly?: boolean; readOnly?: boolean;
}) { }) {
const [animationRef] = useAutoAnimate<HTMLUListElement>(); const [animationRef] = useAutoAnimate<HTMLUListElement>();
value = value || [ if (!value) {
{ onChange([
label: "Option 1", {
value: "1", label: "Option 1",
}, value: "1",
{ },
label: "Option 2", {
value: "2", label: "Option 2",
}, value: "2",
]; },
]);
}
return ( return (
<div className={className}> <div className={className}>
<Label>{label}</Label> <Label>{label}</Label>