fix dropdown bug

This commit is contained in:
anovazzi1 2024-05-28 08:43:48 -03:00
commit 3f43958f08

View file

@ -10,6 +10,7 @@ import {
DropdownMenuItem,
DropdownMenuTrigger,
} from "../../../../components/ui/dropdown-menu";
import { useUpdateNodeInternals } from "reactflow";
export default function OutputComponent({
selected,
@ -19,6 +20,7 @@ export default function OutputComponent({
idx,
}: outputComponentType) {
const setNode = useFlowStore((state) => state.setNode);
const updateNodeInternals = useUpdateNodeInternals();
if (types.length < 2) {
return <span className={cn(frozen ? " text-ice" : "")}>{selected}</span>;
@ -45,6 +47,7 @@ export default function OutputComponent({
type;
return newNode;
});
updateNodeInternals(nodeId);
}}
>
{type}