From 9ad50ea98a8b6bc37a39ad0bab8784c164853b85 Mon Sep 17 00:00:00 2001 From: Neil Fraser Date: Sun, 27 Jun 2021 23:51:46 -0700 Subject: [PATCH] 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 --- core/field_textinput.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/field_textinput.js b/core/field_textinput.js index bd97f5fcb88..9b389c5a849 100644 --- a/core/field_textinput.js +++ b/core/field_textinput.js @@ -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) {