From 797da3bc8e616e42b52f00722b198189a0f01cb5 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Fri, 7 Feb 2020 10:45:45 +0000 Subject: [PATCH] Fix duplicating array item in visual json editor --- .../@node-red/editor-client/src/js/ui/editors/json.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/editors/json.js b/packages/node_modules/@node-red/editor-client/src/js/ui/editors/json.js index 3b83e3089..67b5850c4 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/editors/json.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/editors/json.js @@ -106,7 +106,7 @@ options.push({id:"red-ui-editor-type-json-menu-duplicate", icon:"fa fa-copy", label:RED._("jsonEditor.duplicate"),onselect:function(){ var newKey = item.key; if (item.parent.type === 'array') { - newKey = parent.children.length; + newKey = item.parent.children.length; } else { var m = /^(.*?)(-(\d+))?$/.exec(newKey); var usedKeys = {};