diff --git a/src/assets/javascripts/controllers/autosubmit_controller.js b/src/assets/javascripts/controllers/autosubmit_controller.js index 409a62e2c..ed2cc3fc5 100644 --- a/src/assets/javascripts/controllers/autosubmit_controller.js +++ b/src/assets/javascripts/controllers/autosubmit_controller.js @@ -6,6 +6,10 @@ export default class extends Controller { timeout: Number, }; + static get targets () { + return ['actionButton']; + } + connect () { if (this.modeValue === 'timeout') { let timeout; @@ -23,5 +27,9 @@ export default class extends Controller { submit () { this.element.submit(); + + if (this.hasActionButtonTarget) { + this.actionButtonTarget.disabled = true; + } } }; diff --git a/src/views/_layouts/not_connected.phtml b/src/views/_layouts/not_connected.phtml index 08ddfb292..41e15d377 100644 --- a/src/views/_layouts/not_connected.phtml +++ b/src/views/_layouts/not_connected.phtml @@ -115,6 +115,7 @@ id="locale" name="locale" data-action="autosubmit#submit" + data-autosubmit-target="actionButton" > $locale_name): ?>