diff --git a/app/views/_tailwind/applications/_address_search.html.erb b/app/views/_tailwind/applications/_address_search.html.erb index 32b9bf0a1..aef6a61d6 100644 --- a/app/views/_tailwind/applications/_address_search.html.erb +++ b/app/views/_tailwind/applications/_address_search.html.erb @@ -1,7 +1,7 @@ <% content_for :meta_description, Rails.configuration.planningalerts_meta_description %> <%= render Tailwind::Heading.new(tag: :h1, extra_classes: "sr-only").with_content("Search") %> -<%= render "address_search_form", q:, error: %> +<%= render "address_search_form", q:, error:, autofocus: true %> <% if error.nil? %>
diff --git a/app/views/_tailwind/applications/_address_search_form.html.erb b/app/views/_tailwind/applications/_address_search_form.html.erb index e22485fb0..929fb4e30 100644 --- a/app/views/_tailwind/applications/_address_search_form.html.erb +++ b/app/views/_tailwind/applications/_address_search_form.html.erb @@ -30,7 +30,7 @@ placeholder: "e.g. 1 Sowerby St, Goulburn, NSW 2580", class: class_names("text-xl", "text-navy", "w-full", "px-4", "py-3", "sm:py-4", "placeholder-shown:truncate", "focus:ring-4", "focus:ring-sun-yellow", "border-error-red" => error), required: "required", - autofocus: true, + autofocus:, "x-data" => "{ async initAutocomplete() { const { Autocomplete } = await google.maps.importLibrary('places'); new Autocomplete($el, {componentRestrictions: {country: 'au'}, types: ['address']})} diff --git a/app/views/_tailwind/applications/_address_with_results.html.erb b/app/views/_tailwind/applications/_address_with_results.html.erb index 37091a686..47c51c092 100644 --- a/app/views/_tailwind/applications/_address_with_results.html.erb +++ b/app/views/_tailwind/applications/_address_with_results.html.erb @@ -1,7 +1,7 @@ <% content_for :meta_description, Rails.configuration.planningalerts_meta_description %> <%= render Tailwind::Heading.new(tag: :h1, extra_classes: "sr-only").with_content("Search") %> -<%= render "address_search_form", q:, error: nil %> +<%= render "address_search_form", q:, error: nil, autofocus: false %> <%# TODO: Need a proper design for this section %> <%# TODO: When this section shows up it's not actually clear what the current search is for %> diff --git a/app/views/_tailwind/home/index.html.erb b/app/views/_tailwind/home/index.html.erb index c301a5a12..13473c5a8 100644 --- a/app/views/_tailwind/home/index.html.erb +++ b/app/views/_tailwind/home/index.html.erb @@ -1,7 +1,7 @@ <% content_for :meta_description, Rails.configuration.planningalerts_meta_description %> <%= render "banner" %> -<%= render "applications/address_search_form", q: nil, error: nil %> +<%= render "applications/address_search_form", q: nil, error: nil, autofocus: false %>
<%= render "how_it_works" %>