Keep workflow nodes initialized

This commit is contained in:
2026-07-28 15:51:38 +02:00
parent 1ec8336c02
commit 63e5ce949d
2 changed files with 10 additions and 2 deletions

View File

@@ -67,6 +67,8 @@ export default function WorkflowCanvas({
id: node.id,
type: "workflow" as const,
position: node.position,
initialWidth: 190,
initialHeight: 56,
selected: node.id === selectedNodeId,
data: {
label: node.label,
@@ -171,7 +173,13 @@ export default function WorkflowCanvas({
nodeTypes={nodeTypes}
onInit={setInstance}
onNodesChange={(changes) => {
if (!readOnly) updateNodes(applyNodeChanges(changes, nodes));
if (readOnly) return;
const graphChanges = changes.filter(
(change) => change.type !== "dimensions"
);
if (graphChanges.length) {
updateNodes(applyNodeChanges(graphChanges, nodes));
}
}}
onEdgesChange={(changes) => {
if (!readOnly) updateEdges(applyEdgeChanges(changes, edges));