From 3ee4fe15bb1d470e202932fc1709199747ef1deb Mon Sep 17 00:00:00 2001 From: Neil Fraser Date: Thu, 17 Jun 2021 23:46:50 -0700 Subject: [PATCH] Fix escape key on all fields. Currently the escape key fails to revert the value. This is the inherited root of all type-in fields, including number and angle. 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..50981173a3a 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_.defaultValue); Blockly.WidgetDiv.hide(); Blockly.DropDownDiv.hideWithoutAnimation(); } else if (e.keyCode == Blockly.utils.KeyCodes.TAB) {