summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorJamie Schembri <jamie@schembri.me>2018-07-06 16:14:31 +0200
committerJamie Schembri <jamie@schembri.me>2018-07-06 16:20:44 +0200
commitb40c468b35ecdbef8be490ec0933afb253fad0c6 (patch)
treef10d1fbbb335cf559476a5ddea2406a8a668984e /app
parentb14b31b819f0f09d73e001a80acd528aad913dc9 (diff)
downloadgitlab-ce-b40c468b35ecdbef8be490ec0933afb253fad0c6.tar.gz
Fix #48934 - Focus on text input on danger confirmation
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/confirm_danger_modal.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/assets/javascripts/confirm_danger_modal.js b/app/assets/javascripts/confirm_danger_modal.js
index 1638e09132b..b0c85c2572e 100644
--- a/app/assets/javascripts/confirm_danger_modal.js
+++ b/app/assets/javascripts/confirm_danger_modal.js
@@ -2,13 +2,16 @@ import $ from 'jquery';
import { rstrip } from './lib/utils/common_utils';
function openConfirmDangerModal($form, text) {
+ const $input = $('.js-confirm-danger-input');
+ $input.val('');
+
$('.js-confirm-text').text(text || '');
- $('.js-confirm-danger-input').val('');
$('#modal-confirm-danger').modal('show');
const confirmTextMatch = $('.js-confirm-danger-match').text();
const $submit = $('.js-confirm-danger-submit');
$submit.disable();
+ $input.focus();
$('.js-confirm-danger-input').off('input').on('input', function handleInput() {
const confirmText = rstrip($(this).val());