Fixed dropdown component on editNode

This commit is contained in:
Lucas Oliveira 2023-07-16 16:22:01 -03:00
commit 207e76a09d

View file

@ -1,6 +1,6 @@
import { Listbox, Transition } from "@headlessui/react";
import { Check, ChevronsUpDown } from "lucide-react";
import { Fragment, useState } from "react";
import { Fragment, useEffect, useState } from "react";
import { DropDownComponentType } from "../../types/components";
import { classNames } from "../../utils";
@ -16,6 +16,10 @@ export default function Dropdown({
value === "" || !value ? "Choose an option" : value
);
useEffect(() => {
setInternalValue(value === "" || !value ? "Choose an option" : value);
}, [value]);
return (
<>
<Listbox