Skip to content

Commit

Permalink
fix(tup-cms): make search field required input (#235)
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleyboar authored May 23, 2023
1 parent 5273783 commit 8ca4297
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions apps/tup-cms/src/taccsite_cms/templates/nav_search.raw.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{# TODO: Migrate to Core #}
{# FAQ: The difference is the addition of `required` to the <input> field #}

{# COPIED FROM CORE #}
{# https://github.com/TACC/Core-CMS/blob/f0bad55/taccsite_cms/templates/nav_search.raw.html#L1-L31 #}
{# @var settings #}

{% load static %}
<!-- FAQ: This template loads independently at a unique url (see `urls.py`)
so Portal and User Guide can render this markup into their markup. -->

<style type="text/css">
/* SEE: https://github.com/TACC/Core-Styles/blob/main/source/_imports/elements/tacc-search-bar.md */
:host { visibility: hidden; height: 0; }
</style>
<link rel="stylesheet" href="{% static 'site_cms/css/build/site.tacc-search-bar.css' %}">

<form part="form" method="get" action="/search">
<label for="header-search" class="u-hide--visually" part="label">
Search
</label>

<input part="input"
id="header-search"
type="search"
name="{{ settings.SEARCH_QUERY_PARAM_NAME }}"
placeholder="Search"
data-testid="input"
autocomplete="off" minlength="3" required
value="" />
<input type="hidden" name="page" value="1" />

<button part="button" type="submit" class="icon icon-search">
<span class="u-hide--visually">Search</span>
</button>
</form>

0 comments on commit 8ca4297

Please sign in to comment.