Add useUpdateNodeInternals hook to nodeToolbarComponent fixing handle related bugs
This commit is contained in:
parent
8cd3853e2e
commit
501bc33abb
1 changed files with 4 additions and 0 deletions
|
|
@ -26,6 +26,7 @@ import {
|
||||||
updateFlowPosition,
|
updateFlowPosition,
|
||||||
} from "../../../../utils/reactflowUtils";
|
} from "../../../../utils/reactflowUtils";
|
||||||
import { classNames, cn } from "../../../../utils/utils";
|
import { classNames, cn } from "../../../../utils/utils";
|
||||||
|
import { useUpdateNodeInternals } from "reactflow";
|
||||||
|
|
||||||
export default function NodeToolbarComponent({
|
export default function NodeToolbarComponent({
|
||||||
data,
|
data,
|
||||||
|
|
@ -86,6 +87,8 @@ export default function NodeToolbarComponent({
|
||||||
onCloseAdvancedModal!(false);
|
onCloseAdvancedModal!(false);
|
||||||
}
|
}
|
||||||
}, [showModalAdvanced]);
|
}, [showModalAdvanced]);
|
||||||
|
const updateNodeInternals = useUpdateNodeInternals();
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setFlowComponent(createFlowComponent(cloneDeep(data), version));
|
setFlowComponent(createFlowComponent(cloneDeep(data), version));
|
||||||
|
|
@ -191,6 +194,7 @@ export default function NodeToolbarComponent({
|
||||||
|
|
||||||
return newNode;
|
return newNode;
|
||||||
});
|
});
|
||||||
|
updateNodeInternals(data.id);
|
||||||
};
|
};
|
||||||
|
|
||||||
const [openModal, setOpenModal] = useState(false);
|
const [openModal, setOpenModal] = useState(false);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue