Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove markup related to autocomplete #533

Merged
merged 1 commit into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions app/components/search_bar/component.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div id="search-bar" class="sticky inset-x-0 z-20 flex items-center justify-center px-6 py-4
bg-gradient-to-r from-blue-gradient-2 to-blue-gradient-1 top-20 md:top-22.75 md:gap-5">
<%# Keyword input %>
<div class="relative w-full max-w-xl" data-controller="autocomplete" data-autocomplete-url-value="<%= autocomplete_index_path %>" role="combobox" data-autocomplete-min-length-value="2">
<div class="relative w-full max-w-xl">
<span class="absolute inset-y-0 left-0 flex items-center px-3 pointer-events-none">
<%= inline_svg_tag "solid_search.svg", class: 'h-4 w-4 fill-current text-gray-2' %>
</span>
Expand All @@ -15,13 +15,9 @@ bg-gradient-to-r from-blue-gradient-2 to-blue-gradient-1 top-20 md:top-22.75 md:
data: {
action: "input->search#displayClearKeywordButton",
search_target: "keywordInput",
autocomplete_target: "input",
}
) %>

<ul class="absolute w-full px-1 bg-white rounded-sm" data-autocomplete-target="results" role="listbox">
</ul>

<button
type="button"
class="absolute inset-y-0 right-0 px-3 <%= "hidden" unless params.dig('search', 'keyword').present? %>"
Expand Down
5 changes: 2 additions & 3 deletions app/views/home/index.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ main
| Search for listings of nonprofit organizations based on your needs.
= form_with model: @search, url: search_path, method: :get do |f|
.c-form class="py-0 mx-auto sm:px-3 sm:flex-col sm:justify-center sm:max-w-4xl"
div class="relative w-full sm:max-w-xl mb-7 sm:mb-0" data-controller="autocomplete" data-autocomplete-url-value=autocomplete_index_path role="combobox" data-autocomplete-min-length-value="2"
= f.text_field :keyword, autocomplete: "search", class:"c-input pl-10 m-0 w-full", placeholder: "Try \"Mental Health Nonprofits\"", data: { "autocomplete-target": "input" }
ul class="absolute w-full px-1 bg-white rounded-sm" data-autocomplete-target="results" role="listbox"
div class="relative w-full sm:max-w-xl mb-7 sm:mb-0"
= f.text_field :keyword, autocomplete: "search", class:"c-input pl-10 m-0 w-full", placeholder: "Try \"Mental Health Nonprofits\""
= inline_svg_tag 'search-icon.svg', class:"absolute top-1/3 left-4"
div
= f.submit "Search", class:"c-button mx-10 mt-6"
Expand Down
Loading