Skip to content

Commit

Permalink
Re-break the "double bounce on htmx selects" :(
Browse files Browse the repository at this point in the history
piepworks/cassettenest-roadmap#312

It was causing a bug where when you reset filters, the selects didn't
update (to show the "all" option on everything) because `hx-preserve`
always keeps that element from updating.

We'll have to figure out another way to do this. I intend to look at
some alternatives to htmx anyway.
  • Loading branch information
trey committed Jul 11, 2023
1 parent 9c85016 commit 1c1545d
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 4 deletions.
1 change: 0 additions & 1 deletion inventory/templates/components/section.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ <h3 class="border-0 mb-0 text-lg leading-6 font-medium text-stone-900 dark:text-
hx-target="{{ items.target }}"
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
hx-indicator=".htmx-indicator"
hx-preserve
hx-vals='{"slug": "{{ items.slug }}"{% if items.slug == 'c' and request.GET.p %}, "p": "{{ request.GET.p }}"{% elif items.slug == 'p' and request.GET.c %}, "c": "{{ request.GET.c }}"{% endif %}}'
class="flex">
{% if items.slug == 'c' and request.GET.p %}
Expand Down
1 change: 0 additions & 1 deletion inventory/templates/components/tabs.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
hx-trigger="change"
hx-target="{{ target }}"
hx-indicator=".htmx-indicator"
hx-preserve
class="flex">
<select name="{{ name }}" id="id_{{ name }}_select" class="block dark:bg-stone-700 dark:text-stone-200 w-full pl-3 pr-10 py-2 text-base border-stone-300 dark:border-stone-400 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm rounded-md">
{% for tab in tabs %}
Expand Down
1 change: 0 additions & 1 deletion inventory/templates/inventory/_inventory-content.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ <h2 class="print:hidden text-xl font-semibold mt-6 mb-3">Filters</h2>
hx-trigger="change"
hx-indicator=".htmx-indicator"
hx-target="#inventory-content-wrapper"
hx-preserve
class="print:hidden mb-10">
<div class="field--filter">
<div class="flex flex-col sm:flex-row gap-3">
Expand Down
1 change: 0 additions & 1 deletion inventory/templates/inventory/_stocks-content.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ <h1>
hx-get="{% url 'stocks' %}"
hx-indicator=".htmx-indicator"
hx-trigger="change"
hx-preserve
hx-target=".main-content">
<div class="field--filter">
<div class="flex flex-col sm:flex-row gap-3">
Expand Down

0 comments on commit 1c1545d

Please sign in to comment.