Field widgetdiv flicker (#2911)

* Stop field flickering when the text input is initially shown.
This commit is contained in:
Sam El-Husseini
2019-08-26 08:53:55 -07:00
committed by GitHub
parent 08bd15d676
commit b7097d1add

View File

@@ -266,8 +266,12 @@ Blockly.FieldTextInput.prototype.widgetCreate_ = function() {
htmlInput.value = htmlInput.defaultValue = this.value_;
htmlInput.untypedDefaultValue_ = this.value_;
htmlInput.oldValue_ = null;
// Ensure the browser reflows before resizing to avoid issue #2777.
setTimeout(this.resizeEditor_.bind(this), 0);
if (Blockly.utils.userAgent.GECKO) {
// In FF, ensure the browser reflows before resizing to avoid issue #2777.
setTimeout(this.resizeEditor_.bind(this), 0);
} else {
this.resizeEditor_();
}
this.bindInputEvents_(htmlInput);