Fix escape key on all fields. (#4934)

Currently the escape key fails to revert the value.  This is the inherited root of all type-in fields, including number, angle, and note.

Fixes #4910
This commit is contained in:
Neil Fraser
2021-06-27 23:51:46 -07:00
committed by GitHub
parent 18a27a2613
commit 9ad50ea98a

View File

@@ -456,7 +456,7 @@ Blockly.FieldTextInput.prototype.onHtmlInputKeyDown_ = function(e) {
Blockly.WidgetDiv.hide();
Blockly.DropDownDiv.hideWithoutAnimation();
} else if (e.keyCode == Blockly.utils.KeyCodes.ESC) {
this.htmlInput_.value = this.htmlInput_.defaultValue;
this.setValue(this.htmlInput_.untypedDefaultValue_);
Blockly.WidgetDiv.hide();
Blockly.DropDownDiv.hideWithoutAnimation();
} else if (e.keyCode == Blockly.utils.KeyCodes.TAB) {