Fix options not set when default value is used
parent
8e82cb556b
commit
197ee90eda
|
@ -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>
|
||||||
|
|
Loading…
Reference in New Issue