Skip to content

Commit

Permalink
Fix escape key on all fields.
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 and angle.

Fixes #4910
  • Loading branch information
NeilFraser committed Jun 18, 2021
1 parent a15bbf1 commit 3ee4fe1
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_.defaultValue);
Blockly.WidgetDiv.hide();
Blockly.DropDownDiv.hideWithoutAnimation();
} else if (e.keyCode == Blockly.utils.KeyCodes.TAB) {
Expand Down

0 comments on commit 3ee4fe1

Please sign in to comment.