Skip to content

Commit eb85399

Browse files
authored
operators.js -- fix join text overriding
1 parent e093aa0 commit eb85399

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

blocks_vertical/operators.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -686,8 +686,21 @@ Blockly.Blocks['operators_expandablejoininputs'] = {
686686
fillInBlock: function (connection, index) {
687687
if (connection.sourceBlock_.isInsertionMarker_) return;
688688
const block = this.workspace.newBlock('text');
689-
const text = this.messageList[index];
690-
block.setFieldValue(text ? text : "...", "TEXT");
689+
690+
let textValue = this.messageList[index];
691+
const editingTarget = window.vm.editingTarget;
692+
if (editingTarget) {
693+
const vmBlock = editingTarget.blocks.getBlock(this.id);
694+
if (vmBlock) {
695+
const input = vmBlock.inputs[`INPUT${index + 1}`];
696+
if (input) {
697+
const inpuBlock = editingTarget.blocks.getBlock(input.block);
698+
if (inpuBlock) textValue = inpuBlock.fields.TEXT.value;
699+
}
700+
}
701+
}
702+
703+
block.setFieldValue(textValue !== undefined ? textValue : "...", "TEXT");
691704
block.setShadow(true);
692705
block.initSvg();
693706
block.render(false);

0 commit comments

Comments
 (0)