]> git.openstreetmap.org Git - rails.git/commitdiff
Make the login and signup screens focus on the first input
authorTom Hughes <tom@compton.nu>
Sun, 19 May 2024 18:37:30 +0000 (19:37 +0100)
committerTom Hughes <tom@compton.nu>
Sun, 19 May 2024 18:37:30 +0000 (19:37 +0100)
Fixes #4814

app/views/sessions/new.html.erb
app/views/users/new.html.erb

index 71c0a14f3d2d2c7c58600eb9bcf170f8b5de2704..b493de73b4735d6a6569ae08e4ee12e858973e11 100644 (file)
@@ -35,7 +35,7 @@
   <%= bootstrap_form_tag(:action => "login", :html => { :id => "login_form" }) do |f| %>
     <%= hidden_field_tag("referer", h(params[:referer]), :autocomplete => "off") %>
 
-    <%= f.text_field :username, :label => t(".email or username"), :tabindex => 1, :value => params[:username] %>
+    <%= f.text_field :username, :label => t(".email or username"), :autofocus => true, :tabindex => 1, :value => params[:username] %>
 
     <div class="row">
       <div class="col">
index a2a06836066398b467da603578321a1c93a1ba09..865303f56ba4435d30af6b2da7f147770d99fa93 100644 (file)
@@ -53,6 +53,7 @@
                                                                            t(".privacy_policy_url"),
                                                                            :title => t(".privacy_policy_title"),
                                                                            :target => :new)),
+                                :autofocus => true,
                                 :tabindex => 1 %>
     <% else %>
       <%= f.hidden_field :email %>