From 5a0d1bf9939ab242b9fa403a02aa0d4edf433944 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Tue, 10 Dec 2019 16:37:22 +0100 Subject: [PATCH] :bug: Fix variable selector bug with arrays in arrays --- packages/editor-ui/src/components/VariableSelector.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/editor-ui/src/components/VariableSelector.vue b/packages/editor-ui/src/components/VariableSelector.vue index 7f56a00b55..8a7c7120b1 100644 --- a/packages/editor-ui/src/components/VariableSelector.vue +++ b/packages/editor-ui/src/components/VariableSelector.vue @@ -171,14 +171,16 @@ export default mixins( return returnData; } else if (Array.isArray(inputData)) { let newPropertyName = propertyName; + let newParentPath = parentPath; if (propertyIndex !== undefined) { - newPropertyName += `[${propertyIndex}]`; + newParentPath += `["${propertyName}"]`; + newPropertyName = propertyIndex.toString(); } const arrayData: IVariableSelectorOption[] = []; for (let i = 0; i < inputData.length; i++) { - arrayData.push.apply(arrayData, this.jsonDataToFilterOption(inputData[i], parentPath, newPropertyName, filterText, i, `[Item: ${i}]`, skipKey)); + arrayData.push.apply(arrayData, this.jsonDataToFilterOption(inputData[i], newParentPath, newPropertyName, filterText, i, `[Item: ${i}]`, skipKey)); } returnData.push(