Files
fizzy/app/views/searches/_form.html.erb
T
Adrien Maston 5d6f3f5156 Allow search perma's form to target the whole page
... to pick up the url change and <head> update
2025-12-18 10:13:55 +01:00

17 lines
839 B
Plaintext

<%= form_with url: search_path, method: :get, class: "search__form flex align-center justify-center gap-half", data: { bar_target: "form", turbo_frame: defined?(target_turbo_frame) ? target_turbo_frame : nil } do |form| %>
<%= form.label :q, "Search Fizzy", class: "font-weight-black txt-nowrap" %>
<%= text_field_tag :q, query_terms,
class: "search__input input",
type: "search",
placeholder: "Find something…",
autocomplete: "off",
autofocus: true,
data: {
bar_target: "searchInput",
action: "keydown.enter->bar#showModalAndSubmit:prevent keydown.esc->bar#reset" } %>
<button class="search__reset btn btn--circle borderless" data-action="bar#clearInput">
<%= icon_tag "close" %>
<span class="for-screen-reader">Close search</span>
</button>
<% end %>