From 5db18cbf18f3c540ea99d49d990d8071d7e96869 Mon Sep 17 00:00:00 2001 From: Peter Stockings Date: Sun, 10 Nov 2024 18:01:30 +1100 Subject: [PATCH] Clear exercise select dropdown when clear search is clicked --- templates/partials/exercise/exercise_select.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/partials/exercise/exercise_select.html b/templates/partials/exercise/exercise_select.html index eda9112..99e1763 100644 --- a/templates/partials/exercise/exercise_select.html +++ b/templates/partials/exercise/exercise_select.html @@ -4,7 +4,11 @@ id="exercise-search" type="search" name="query" placeholder="Search exercises..." hx-get="{{ url_for('get_exercises', person_id=person_id) }}" hx-target="#exercise-results" hx-trigger="keyup changed delay:500ms" hx-swap="innerHTML" autocomplete="off" {% if has_value==True %} - value="{{ exercise_name }}" {% endif %}> + value="{{ exercise_name }}" {% endif %} _=" + on input + if this.value is empty + set the innerHTML of #exercise-results to '' + ">