summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorErlend <erlendniko@hotmail.com>2022-06-29 11:06:36 +0200
committerErlend <erlendniko@hotmail.com>2022-06-29 11:06:36 +0200
commit85aae55a270d6688a73c6fff7fa361c061b2e2ff (patch)
tree0fad08daf5f1f5cf6c86b6b011d49e9fa3c04bcd /client
parent97329e35fed9fff68a571738b053af9d1fbbd694 (diff)
New choice can now be selected from the dropdown without leaving orphans
Diffstat (limited to 'client')
-rw-r--r--client/js/app/src/app/pages/querybuilder/Components/Text/QueryDropDownForm.jsx2
1 files changed, 2 insertions, 0 deletions
diff --git a/client/js/app/src/app/pages/querybuilder/Components/Text/QueryDropDownForm.jsx b/client/js/app/src/app/pages/querybuilder/Components/Text/QueryDropDownForm.jsx
index 67b00faf242..cdcfe1d0408 100644
--- a/client/js/app/src/app/pages/querybuilder/Components/Text/QueryDropDownForm.jsx
+++ b/client/js/app/src/app/pages/querybuilder/Components/Text/QueryDropDownForm.jsx
@@ -28,11 +28,13 @@ export default function QueryDropdownForm({ choices, id, child = false }) {
index = children.findIndex((element) => element.id === id);
children[index].type = newType;
children[index].hasChildren = childChoices[newType].hasChildren;
+ children[index].children = [];
} else {
const index = newInputs.findIndex((element) => element.id === id);
newInputs[index].type = newType;
let hasChildren = levelZeroParameters[newType].hasChildren;
newInputs[index].hasChildren = hasChildren;
+ newInputs[index].children = [];
}
setInputs(newInputs);
};