diff --git a/app/assets/javascripts/protocols/new_protocol.js b/app/assets/javascripts/protocols/new_protocol.js index 6221ed085..7d27af997 100644 --- a/app/assets/javascripts/protocols/new_protocol.js +++ b/app/assets/javascripts/protocols/new_protocol.js @@ -8,6 +8,7 @@ .on('show.bs.modal', function() { $(`${protocolModal} #protocol_name`).parent().removeClass('error'); $(`${protocolModal} #protocol_name`).val(''); + $(this).find('.sci-input-field').focus(); }); let roleSelector = `${protocolModal} #protocol_role_selector`; @@ -22,6 +23,9 @@ }); $(protocolModal) + .on('shown.bs.modal', function() { + $(this).find('.sci-input-field').focus(); + }) .on('ajax:error', 'form', function(e, error) { let msg = error.responseJSON.error; $(`${protocolModal} #protocol_name`).parent().addClass('error').attr('data-error-text', msg); diff --git a/app/assets/javascripts/shared/swap_remote_container.js b/app/assets/javascripts/shared/swap_remote_container.js index 1d8199d8b..13f4e8a6d 100644 --- a/app/assets/javascripts/shared/swap_remote_container.js +++ b/app/assets/javascripts/shared/swap_remote_container.js @@ -14,6 +14,7 @@ let newContainer = $(html).find(targetID).length ? $(html).find(targetID) : $(html); targetElement.replaceWith(newContainer); newContainer.find('.selectpicker').selectpicker(); + newContainer.find('.new-assignment-user-search').focus(); if (flash) { HelperModule.flashAlertMsg(flash, 'success'); diff --git a/app/javascript/vue/protocol/modals/publish_protocol.vue b/app/javascript/vue/protocol/modals/publish_protocol.vue index 1d5793c0b..9389cbb3c 100644 --- a/app/javascript/vue/protocol/modals/publish_protocol.vue +++ b/app/javascript/vue/protocol/modals/publish_protocol.vue @@ -15,7 +15,11 @@