Use the HTML5 autofocus attribute, and focus on load for browsers which don't support it. Also change the removal of the "Where am I?" prompt to happen on input rather than when the field is focused, so that it is properly removed and restored when the field has been autofocused. Fixes https://trac.openstreetmap.org/ticket/5065
7 lines
408 B
Text
7 lines
408 B
Text
<%= form_tag search_path, :class => "search_form" do %>
|
|
<%= submit_tag t('site.search.submit_text') %>
|
|
<div class='query_wrapper'>
|
|
<input type="text" name="query" value="<%= params[:query] %>" placeholder="<%= t('site.search.search') %>" autofocus>
|
|
<%= link_to t('site.search.where_am_i'), '#', { :class => "describe_location", :title => t('site.search.where_am_i_title') } %>
|
|
</div>
|
|
<% end %>
|