From 685363d947efeb671f3ed2b09a8e4f65d53de1a6 Mon Sep 17 00:00:00 2001 From: Thiemo Kreuz Date: Fri, 23 Sep 2022 11:20:45 +0200 Subject: [PATCH] Set focus to first input field on all panels * This is most notably when adding a new parameter. The cursor should start in the input field. * Focus the first input field when editing a parameter, whatever that input field is. * Focus the big JSON editor when editing a map. Change-Id: I5a3df626810007e83bd2300b540df75bc1b8cac4 --- modules/ext.templateDataGenerator.editTemplatePage/Dialog.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/ext.templateDataGenerator.editTemplatePage/Dialog.js b/modules/ext.templateDataGenerator.editTemplatePage/Dialog.js index 918a17c3..3676991a 100644 --- a/modules/ext.templateDataGenerator.editTemplatePage/Dialog.js +++ b/modules/ext.templateDataGenerator.editTemplatePage/Dialog.js @@ -1548,6 +1548,7 @@ Dialog.prototype.switchPanels = function ( panel ) { this.addParamPanel.$element.hide(); this.editParamPanel.$element.show(); this.editMapsPanel.$element.hide(); + this.editParamPanel.focus(); break; case 'addParam': this.actions.setMode( 'add' ); @@ -1558,6 +1559,7 @@ Dialog.prototype.switchPanels = function ( panel ) { this.languagePanel.$element.hide(); this.addParamPanel.$element.show(); this.editMapsPanel.$element.hide(); + this.newParamInput.focus(); break; case 'editMaps': this.actions.setMode( 'maps' ); @@ -1568,7 +1570,7 @@ Dialog.prototype.switchPanels = function ( panel ) { this.languagePanel.$element.hide(); this.addParamPanel.$element.hide(); this.editMapsPanel.$element.show(); - this.templateMapsInput.adjustSize( true ); + this.templateMapsInput.adjustSize( true ).focus(); break; case 'language': this.actions.setMode( 'language' );