]> git.openstreetmap.org Git - rails.git/commitdiff
Merge pull request #4816 from tomhughes/login-focus
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 22 May 2024 11:06:38 +0000 (12:06 +0100)
committerGitHub <noreply@github.com>
Wed, 22 May 2024 11:06:38 +0000 (12:06 +0100)
Make the login and signup screens focus on the first input

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 %>