mirror of
https://github.com/google/blockly.git
synced 2026-01-08 17:40:09 +01:00
Add tabbing between text fields.
This commit is contained in:
@@ -170,12 +170,16 @@ Blockly.FieldTextInput.prototype.showEditor_ = function(opt_quietInput) {
|
||||
*/
|
||||
Blockly.FieldTextInput.prototype.onHtmlInputKeyDown_ = function(e) {
|
||||
var htmlInput = Blockly.FieldTextInput.htmlInput_;
|
||||
var enterKey = 13, escKey = 27;
|
||||
var tabKey = 9, enterKey = 13, escKey = 27;
|
||||
if (e.keyCode == enterKey) {
|
||||
Blockly.WidgetDiv.hide();
|
||||
} else if (e.keyCode == escKey) {
|
||||
this.setText(htmlInput.defaultValue);
|
||||
Blockly.WidgetDiv.hide();
|
||||
} else if (e.keyCode == tabKey) {
|
||||
Blockly.WidgetDiv.hide();
|
||||
this.sourceBlock_.tab(this, !e.shiftKey);
|
||||
e.preventDefault();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user