Skip to content

Commit

Permalink
Fix escape key on all fields. (#4934)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
NeilFraser authored Jun 28, 2021
1 parent 18a27a2 commit 9ad50ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/field_textinput.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 9ad50ea

Please sign in to comment.