Bugfix: search fields interacted in a wrong way on tag list
This commit is contained in:
parent
2d7dd98b5b
commit
41262ee1d9
2 changed files with 3 additions and 4 deletions
|
@ -41,7 +41,7 @@
|
|||
<a href="{% url 'search' %}" onclick="showSearch(event)"><img class="icon" title="Search" src="{% static "inventory/img/search.svg" %}"></a>
|
||||
<div id="search-container">
|
||||
<form action="{% url 'search' %}" method="get">
|
||||
<input name="q" id="search" type="text">
|
||||
<input name="q" id="search" type="text" placeholder="Search">
|
||||
<button type="submit">Search</button>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
{% block content %}
|
||||
<script>
|
||||
function updateSearch(e) {
|
||||
const input = document.getElementById('search');
|
||||
const input = document.getElementById('tag-search');
|
||||
const text = input.value.toLowerCase();
|
||||
|
||||
if (text.length >= 2) {
|
||||
|
@ -39,8 +39,7 @@
|
|||
}
|
||||
</script>
|
||||
<form>
|
||||
<label for="search">Search:</label>
|
||||
<input type="text" id="search" name="search" oninput="updateSearch(event)">
|
||||
<input type="text" id="tag-search" name="tag-search" placeholder="Search" oninput="updateSearch(event)">
|
||||
<button onclick="updateSearch(event)">Search</button>
|
||||
</form>
|
||||
<ul class="tag-list" id="tagcloud">
|
||||
|
|
Loading…
Reference in a new issue