Revert on blur for text input fields as it interferes with combo boxes (#3634)

This commit is contained in:
Sam El-Husseini
2020-01-22 11:23:33 -08:00
committed by GitHub
parent cf90154b23
commit 5727a62c62

View File

@@ -85,13 +85,6 @@ Blockly.FieldTextInput = function(opt_value, opt_validator, opt_config) {
*/
this.onKeyInputWrapper_ = null;
/**
* Blur input event data.
* @type {?Blockly.EventData}
* @private
*/
this.onBlurInputWrapper_ = null;
/**
* Whether the field should consider the whole parent block to be its click
* target.
@@ -432,9 +425,6 @@ Blockly.FieldTextInput.prototype.bindInputEvents_ = function(htmlInput) {
this.onKeyInputWrapper_ =
Blockly.bindEventWithChecks_(
htmlInput, 'input', this, this.onHtmlInputChange_);
this.onBlurInputWrapper_ =
Blockly.bindEventWithChecks_(
htmlInput, 'blur', this, this.onHtmlInputBlur_);
};
/**
@@ -450,10 +440,6 @@ Blockly.FieldTextInput.prototype.unbindInputEvents_ = function() {
Blockly.unbindEvent_(this.onKeyInputWrapper_);
this.onKeyInputWrapper_ = null;
}
if (this.onBlurInputWrapper_) {
Blockly.unbindEvent_(this.onBlurInputWrapper_);
this.onBlurInputWrapper_ = null;
}
};
/**
@@ -499,16 +485,6 @@ Blockly.FieldTextInput.prototype.onHtmlInputChange_ = function(_e) {
}
};
/**
* Handle blur for the editor.
* @param {!Event} _e Focus event.
* @protected
*/
Blockly.FieldTextInput.prototype.onHtmlInputBlur_ = function(_e) {
Blockly.WidgetDiv.hide();
Blockly.DropDownDiv.hideWithoutAnimation();
};
/**
* Set the html input value and the field's internal value. The difference
* between this and ``setValue`` is that this also updates the html input