Keep dataflow nodes initialized
This commit is contained in:
@@ -14,6 +14,8 @@ const checks = [
|
||||
[canvas.includes("application/x-govoplan-dataflow-node"), "palette drop handling"],
|
||||
[canvas.includes("isValidConnection"), "edge validation"],
|
||||
[canvas.includes("connectionRadius={32}"), "visible connection drop radius"],
|
||||
[canvas.includes("initialWidth: 180"), "known initial node width"],
|
||||
[canvas.includes('change.type !== "dimensions"'), "measurement-only change filtering"],
|
||||
[
|
||||
moduleEntry.indexOf("@xyflow/react/dist/style.css") <
|
||||
moduleEntry.indexOf("./styles/dataflow.css"),
|
||||
|
||||
@@ -69,6 +69,8 @@ export default function DataflowCanvas({
|
||||
id: node.id,
|
||||
type: "dataflow",
|
||||
position: node.position,
|
||||
initialWidth: 180,
|
||||
initialHeight: node.type.startsWith("combine.") ? 64 : 54,
|
||||
selected: node.id === selectedNodeId,
|
||||
data: {
|
||||
label: node.label,
|
||||
@@ -180,7 +182,10 @@ export default function DataflowCanvas({
|
||||
onInit={setInstance}
|
||||
onNodesChange={(changes) => {
|
||||
if (readOnly) return;
|
||||
updateNodes(applyNodeChanges(changes, nodes));
|
||||
const graphChanges = changes.filter((change) => change.type !== "dimensions");
|
||||
if (graphChanges.length) {
|
||||
updateNodes(applyNodeChanges(graphChanges, nodes));
|
||||
}
|
||||
}}
|
||||
onEdgesChange={(changes) => {
|
||||
if (readOnly) return;
|
||||
|
||||
Reference in New Issue
Block a user