Fix field colour in headless (#3795)

This commit is contained in:
Sam El-Husseini
2020-04-03 14:36:19 -07:00
committed by GitHub
parent dfbcab7645
commit 06f6c22a27

View File

@@ -220,7 +220,7 @@ Blockly.FieldColour.prototype.doValueUpdate_ = function(newValue) {
this.value_ = newValue;
if (this.borderRect_) {
this.borderRect_.style.fill = newValue;
} else if (this.sourceBlock_) {
} else if (this.sourceBlock_ && this.sourceBlock_.rendered) {
this.sourceBlock_.pathObject.svgPath.setAttribute('fill', newValue);
this.sourceBlock_.pathObject.svgPath.setAttribute('stroke', '#fff');
}