Unverified Commit 83eacf43 authored by Beka Westberg's avatar Beka Westberg Committed by GitHub

Fix mutators not removing empty input (#2057)

parent 7f0e2484
...@@ -41,8 +41,14 @@ Blockly.domToMutation = function(container) { ...@@ -41,8 +41,14 @@ Blockly.domToMutation = function(container) {
} }
} }
for (var x = 0; x < this.itemCount_; x++) { if (this.itemCount_ == 0) {
this.removeInput(this.repeatingInputName + x); if (this.emptyInputName != null) {
this.removeInput(this.emptyInputName);
}
} else {
for (var x = 0; x < this.itemCount_; x++) {
this.removeInput(this.repeatingInputName + x);
}
} }
this.itemCount_ = window.parseInt(container.getAttribute('items'), 10); this.itemCount_ = window.parseInt(container.getAttribute('items'), 10);
for (var x = 0; x < this.itemCount_; x++) { for (var x = 0; x < this.itemCount_; x++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment