mirror of
https://github.com/scratchfoundation/scratch-blocks.git
synced 2025-07-29 23:29:05 -04:00
Add tabbing between text fields.
This commit is contained in:
parent
c83faa3314
commit
ded524ff3a
3 changed files with 49 additions and 3 deletions
|
@ -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();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue