update node internals on editNodeModal

This commit is contained in:
anovazzi1 2023-10-23 22:40:55 -03:00
commit 6f40a94b55

View file

@ -7,6 +7,7 @@ import {
useRef,
useState,
} from "react";
import { useUpdateNodeInternals } from "reactflow";
import ShadTooltip from "../../components/ShadTooltipComponent";
import CodeAreaComponent from "../../components/codeAreaComponent";
import DictComponent from "../../components/dictComponent";
@ -64,6 +65,7 @@ const EditNodeModal = forwardRef(
ref
) => {
const [modalOpen, setModalOpen] = useState(open ?? false);
const updateNodeInternals = useUpdateNodeInternals();
const myData = useRef(data);
@ -83,6 +85,7 @@ const EditNodeModal = forwardRef(
const handleOnNewValue = (newValue: any, name) => {
myData.current.node!.template[name].value = newValue;
setDataValue(newValue);
updateNodeInternals(data.id);
};
useEffect(() => {