diff --git a/awx/ui/client/src/templates/prompt/steps/other-prompts/prompt-other-prompts.controller.js b/awx/ui/client/src/templates/prompt/steps/other-prompts/prompt-other-prompts.controller.js index 32ab75c786..b4b4fa4337 100644 --- a/awx/ui/client/src/templates/prompt/steps/other-prompts/prompt-other-prompts.controller.js +++ b/awx/ui/client/src/templates/prompt/steps/other-prompts/prompt-other-prompts.controller.js @@ -12,7 +12,7 @@ export default let scope; - vm.init = (_scope_) => { + vm.init = (_scope_, controller, el) => { scope = _scope_; scope.parseType = 'yaml'; @@ -102,6 +102,13 @@ export default return ToJSON(scope.parseType, scope.extraVariables, true); } scope.validate = validate; + + angular.element(el).ready(() => { + const inputs = el.find('input, select'); + if (inputs.length) { + inputs.get(0).focus(); + } + }); }; diff --git a/awx/ui/client/src/templates/prompt/steps/other-prompts/prompt-other-prompts.directive.js b/awx/ui/client/src/templates/prompt/steps/other-prompts/prompt-other-prompts.directive.js index 361f60e145..38ac48ef6b 100644 --- a/awx/ui/client/src/templates/prompt/steps/other-prompts/prompt-other-prompts.directive.js +++ b/awx/ui/client/src/templates/prompt/steps/other-prompts/prompt-other-prompts.directive.js @@ -28,7 +28,7 @@ export default [ 'templateUrl', const launchController = controllers[0]; const promptOtherPromptsController = controllers[1]; - promptOtherPromptsController.init(scope, launchController); + promptOtherPromptsController.init(scope, launchController, el); } }; }];