Fixed dependency loops created by inactive props

depending on their parent toggles
This commit is contained in:
Stefan Zermatten
2022-08-16 11:19:16 +02:00
parent 79c9e67ce2
commit 34e3325464
3 changed files with 23 additions and 6 deletions

View File

@@ -10,8 +10,10 @@ export default function computeToggleDependencies(node, dependencyGraph){
prop.enabled
) return;
walkDown(node.children, child => {
child.node._computationDetails.toggleAncestors.push(prop);
// Only for children that aren't inactive
if (child.node.inactive) return;
// The child nodes depend on the toggle condition compuation
child.node._computationDetails.toggleAncestors.push(prop);
dependencyGraph.addLink(child.node._id, prop._id, 'toggle');
});
}