fix dropdown bug
This commit is contained in:
parent
9d38ccc15d
commit
3f43958f08
1 changed files with 3 additions and 0 deletions
|
|
@ -10,6 +10,7 @@ import {
|
||||||
DropdownMenuItem,
|
DropdownMenuItem,
|
||||||
DropdownMenuTrigger,
|
DropdownMenuTrigger,
|
||||||
} from "../../../../components/ui/dropdown-menu";
|
} from "../../../../components/ui/dropdown-menu";
|
||||||
|
import { useUpdateNodeInternals } from "reactflow";
|
||||||
|
|
||||||
export default function OutputComponent({
|
export default function OutputComponent({
|
||||||
selected,
|
selected,
|
||||||
|
|
@ -19,6 +20,7 @@ export default function OutputComponent({
|
||||||
idx,
|
idx,
|
||||||
}: outputComponentType) {
|
}: outputComponentType) {
|
||||||
const setNode = useFlowStore((state) => state.setNode);
|
const setNode = useFlowStore((state) => state.setNode);
|
||||||
|
const updateNodeInternals = useUpdateNodeInternals();
|
||||||
|
|
||||||
if (types.length < 2) {
|
if (types.length < 2) {
|
||||||
return <span className={cn(frozen ? " text-ice" : "")}>{selected}</span>;
|
return <span className={cn(frozen ? " text-ice" : "")}>{selected}</span>;
|
||||||
|
|
@ -45,6 +47,7 @@ export default function OutputComponent({
|
||||||
type;
|
type;
|
||||||
return newNode;
|
return newNode;
|
||||||
});
|
});
|
||||||
|
updateNodeInternals(nodeId);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{type}
|
{type}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue