From e794b6883f7c2081d346b4e858d0a63829e15d57 Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Mon, 6 Aug 2018 17:12:14 -0700 Subject: [PATCH] Make insertion markers match the size of the source block --- core/insertion_marker_manager.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/insertion_marker_manager.js b/core/insertion_marker_manager.js index ca64ee8df..0b43f000c 100644 --- a/core/insertion_marker_manager.js +++ b/core/insertion_marker_manager.js @@ -271,6 +271,17 @@ Blockly.InsertionMarkerManager.prototype.createMarkerBlock_ = function(sourceBlo result.domToMutation(oldMutationDom); } } + // Copy field values from the other block. These values may impact the + // rendered size of the insertion marker. Note that we do not care about + // child blocks here. + for (var i = 0; i < sourceBlock.inputList.length; i++) { + var input = sourceBlock.inputList[i]; + for (var j = 0; j < input.fieldRow.length; j++) { + var field = input.fieldRow[j]; + result.setFieldValue(field.getValue(), field.name); + } + } + result.initSvg(); result.getSvgRoot().setAttribute('visibility', 'hidden'); } finally {