diff --git a/src/engine/blocks.js b/src/engine/blocks.js index 30558d267..93b865770 100644 --- a/src/engine/blocks.js +++ b/src/engine/blocks.js @@ -298,7 +298,7 @@ class Blocks { if (!block.fields[args.name]) return; if (args.name === 'VARIABLE') { // Get variable name using the id in args.value. - const variable = optRuntime.getEditingTarget().lookupVariableById(args.id); + const variable = optRuntime.getEditingTarget().lookupVariableById(args.value); if (variable) { block.fields[args.name].value = variable.name; block.fields[args.name].id = args.value; diff --git a/src/engine/target.js b/src/engine/target.js index 9d135687e..2a6be81a6 100644 --- a/src/engine/target.js +++ b/src/engine/target.js @@ -169,7 +169,7 @@ class Target extends EventEmitter { id: id, element: 'field', name: 'VARIABLE', - value: newName + value: id }, this.runtime); this.runtime.requestUpdateMonitor(Map({ id: id,