diff options
author | Jamie Schembri <jamie@schembri.me> | 2018-07-06 16:14:31 +0200 |
---|---|---|
committer | Jamie Schembri <jamie@schembri.me> | 2018-07-06 16:20:44 +0200 |
commit | b40c468b35ecdbef8be490ec0933afb253fad0c6 (patch) | |
tree | f10d1fbbb335cf559476a5ddea2406a8a668984e /app | |
parent | b14b31b819f0f09d73e001a80acd528aad913dc9 (diff) | |
download | gitlab-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.js | 5 |
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()); |