From aaa24074f3bb1af435c522f6de640f905a3fc8bb Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Tue, 4 Nov 2025 13:18:14 -0600 Subject: [PATCH] Fix magic link code input Fix that paste action didn't work and hitting `enter` caused the form to post twice --- app/views/sessions/magic_links/show.html.erb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/sessions/magic_links/show.html.erb b/app/views/sessions/magic_links/show.html.erb index 57932a475..cf81f458d 100644 --- a/app/views/sessions/magic_links/show.html.erb +++ b/app/views/sessions/magic_links/show.html.erb @@ -9,10 +9,10 @@

If your email is on a different device, enter the code included in the email below.

<%= form_with url: session_magic_link_path, method: :post, html: { data: { controller: token_list("form", "auto-submit" => params[:code].present?)} } do |form| %> - <%= form.text_field :code, required: true, class: "input center txt-align-enter txt-normal", - autofocus: false, autocorrect: "off", autocapitalize: "off", spellcheck: "false", "data-1p-ignore": true, - autocomplete: "one-time-code", maxlength: "6", placeholder: "••••••", value: params[:code], - data: { form_target: "input", action: "paste->form#submit, keydown.enter->form#submit" } %> + <%= form.text_field :code, required: true, class: "input center txt-align-enter txt-normal", + autofocus: false, autocorrect: "off", autocapitalize: "off", spellcheck: "false", "data-1p-ignore": true, + autocomplete: "one-time-code", maxlength: "6", placeholder: "••••••", value: params[:code], + data: { form_target: "input", action: "paste->form#debouncedSubmit" } %> <% end %>