Merge pull request #2558 from BeksOmega/fixes/ReadOnlyFields

Fixed Fields Still Being Editable on Non-Editable Blocks
This commit is contained in:
Rachel Fenichel
2019-06-11 11:09:26 -07:00
committed by GitHub

View File

@@ -369,7 +369,8 @@ Blockly.Field.prototype.updateEditable = function() {
* @return {boolean} Whether this field is clickable.
*/
Blockly.Field.prototype.isClickable = function() {
return !!this.showEditor_ && (typeof this.showEditor_ === 'function');
return !!this.sourceBlock_ && this.sourceBlock_.isEditable() &&
!!this.showEditor_ && (typeof this.showEditor_ === 'function');
};
/**