diff --git a/app/assets/javascripts/issue_show/components/app.vue b/app/assets/javascripts/issue_show/components/app.vue index e4e2eab2acd..cd569eb3045 100644 --- a/app/assets/javascripts/issue_show/components/app.vue +++ b/app/assets/javascripts/issue_show/components/app.vue @@ -10,6 +10,7 @@ import descriptionComponent from './description.vue'; import editedComponent from './edited.vue'; import formComponent from './form.vue'; import recaptchaModalImplementor from '../../vue_shared/mixins/recaptcha_modal_implementor'; +import { __ } from '~/locale'; export default { components: { @@ -201,8 +202,8 @@ export default { methods: { handleBeforeUnloadEvent(e) { const event = e; - if (this.showForm && this.issueChanged) { - event.returnValue = 'Are you sure you want to lose your issue information?'; + if (this.showForm && this.issueChanged && !this.showRecaptcha) { + event.returnValue = __('Are you sure you want to lose your issue information?'); } return undefined; }, diff --git a/changelogs/unreleased/44698-recaptcha.yml b/changelogs/unreleased/44698-recaptcha.yml new file mode 100644 index 00000000000..e1760a6c635 --- /dev/null +++ b/changelogs/unreleased/44698-recaptcha.yml @@ -0,0 +1,5 @@ +--- +title: Prevent unload when Recaptcha is open +merge_request: 24625 +author: +type: fixed diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 0ff03e7fb2b..b4e28f4bb8f 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -714,6 +714,9 @@ msgstr "" msgid "Are you sure you want to lose unsaved changes?" msgstr "" +msgid "Are you sure you want to lose your issue information?" +msgstr "" + msgid "Are you sure you want to regenerate the public key? You will have to update the public key on the remote server before mirroring will work again." msgstr ""