mirror of
https://github.com/google/blockly.git
synced 2026-01-10 02:17:09 +01:00
Fix issue 2061 (#2326)
This commit is contained in:
@@ -829,6 +829,21 @@ Blockly.Blocks['lists_split'] = {
|
||||
* @this Blockly.Block
|
||||
*/
|
||||
updateType_: function(newMode) {
|
||||
var mode = this.getFieldValue('MODE');
|
||||
if (mode != newMode) {
|
||||
this.setFieldValue(newMode, 'MODE');
|
||||
var inputConnection = this.getInput('INPUT').connection;
|
||||
inputConnection.setShadowDom(null);
|
||||
var inputBlock = inputConnection.targetBlock();
|
||||
if (inputBlock) {
|
||||
inputConnection.disconnect();
|
||||
if (inputBlock.isShadow()) {
|
||||
inputBlock.dispose();
|
||||
} else {
|
||||
this.bumpNeighbours_();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (newMode == 'SPLIT') {
|
||||
this.outputConnection.setCheck('Array');
|
||||
this.getInput('INPUT').setCheck('String');
|
||||
|
||||
Reference in New Issue
Block a user