Skip to content

Prevent double proposal submission from a double-clicked submit button#1135

Merged
amatsuda merged 1 commit into
rubycentral:mainfrom
amatsuda:prevent_double_proposal_submission
Jul 11, 2026
Merged

Prevent double proposal submission from a double-clicked submit button#1135
amatsuda merged 1 commit into
rubycentral:mainfrom
amatsuda:prevent_double_proposal_submission

Conversation

@amatsuda

Copy link
Copy Markdown
Collaborator

This app disables Turbo Drive globally (opt-in), so the proposal form submits as a plain full-page POST with no double-submit protection — Turbo's submitter disabling never engages and rails-ujs disable_with is no longer bundled. A double click during a slow response POSTed twice and created duplicate proposals.

Add a small generic disable-submit Stimulus controller that disables the form's submit buttons on the next tick after the submit event (so the form data set, including a named submitter, is built first), and wire it to the proposal new/edit forms.

This app disables Turbo Drive globally (opt-in), so the proposal form
submits as a plain full-page POST with no double-submit protection —
Turbo's submitter disabling never engages and rails-ujs disable_with is
no longer bundled. A double click during a slow response POSTed twice
and created duplicate proposals.

Add a small generic disable-submit Stimulus controller that disables
the form's submit buttons on the next tick after the submit event (so
the form data set, including a named submitter, is built first), and
wire it to the proposal new/edit forms.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@amatsuda amatsuda merged commit 0bc302c into rubycentral:main Jul 11, 2026
1 check passed
@amatsuda amatsuda deleted the prevent_double_proposal_submission branch July 11, 2026 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant