proud-librarian-99598
10/02/2021, 3:23 PMproud-librarian-99598
10/02/2021, 3:24 PMproud-librarian-99598
10/02/2021, 3:25 PMmysterious-toddler-20573
10/02/2021, 3:32 PMmysterious-toddler-20573
10/02/2021, 3:32 PMadamant-exabyte-92636
10/02/2021, 4:02 PMhtmx-added class in a transition?mysterious-toddler-20573
10/02/2021, 4:08 PM<script src="/foo.js"/> tag, it will now load (previously we only evaluated inline scripts)mysterious-toddler-20573
10/02/2021, 4:10 PMunset to "cancel" an attribute that would normally be inherited:
html
<div hx-confirm="Blah blah" ...>
<a hx-confirm="unset" ...>No Confirm</a>
</div>mysterious-toddler-20573
10/02/2021, 4:10 PMmysterious-toddler-20573
10/02/2021, 4:13 PM.htmx-settling but is added on the newly added content, rather than the target:
html
<a hx-get="/example' hx-target="#div1">...</a>
<!-- this div would get the .htmx-settling class -->
<div id="div1">
<!-- these ps would get the .htmx-added class -->
<p> Some Content...</p>
<p> Some More Content...</p>
</div>mysterious-toddler-20573
10/02/2021, 4:13 PMhx-swap='outerHTML' the target and the added content are the same 🙂mysterious-toddler-20573
10/02/2021, 4:15 PMmysterious-toddler-20573
10/02/2021, 4:21 PMadamant-exabyte-92636
10/02/2021, 5:58 PMgifted-receptionist-30316
10/03/2021, 4:15 AMgifted-receptionist-30316
10/03/2021, 4:15 AMgifted-receptionist-30316
10/03/2021, 4:19 AMproud-librarian-99598
10/03/2021, 7:16 AMHX-Trigger: itemAdded response header
3) On a different place on the page, I have this:
<span th:fragment="active-items-count"
id="active-items-count"
class="todo-count"
hx-get="/active-items-count"
hx-trigger="itemAdded from:body">
So HTMX does a GET request upon receiving the itemAdded response header
But if I check the developer console the GET to /active-items-count is done 2 times. I also added htmx.logAll() but I only see 1 itemAdded event being logged. Is there anything else I can look at to see why the GET is done twice?
I am using version 1.5.0.gifted-receptionist-30316
10/03/2021, 7:24 AMgifted-receptionist-30316
10/03/2021, 7:24 AMproud-librarian-99598
10/03/2021, 7:25 AMgifted-receptionist-30316
10/03/2021, 7:25 AMproud-librarian-99598
10/03/2021, 7:25 AMgifted-receptionist-30316
10/03/2021, 7:26 AMgifted-receptionist-30316
10/03/2021, 7:27 AMproud-librarian-99598
10/03/2021, 7:31 AMproud-librarian-99598
10/03/2021, 7:32 AMproud-librarian-99598
10/03/2021, 7:35 AMhx-boost. I just noticed that I can replace all my custom stuff in my blog post with just adding this attribute and I have an SPA instantly! The only place where it does not work is where a checkbox triggers a form via JavaScript:
<form th:id="|toggle-item-form-${item.id}|"
th:action="@{/{id}/toggle(id=${item.id})}" th:method="put">
<input th:id="|toggle-checkbox-${item.id}|"
class="toggle" type="checkbox"
onchange="this.form.submit()"
th:attrappend="checked=${item.completed?'true':null}">
<label th:text="${item.title}">Taste JavaScript</label>
</form>
(The onchange attribute)
Could I code this in a different way so that hx-boost would work here as well?gifted-receptionist-30316
10/03/2021, 7:39 AMgifted-receptionist-30316
10/03/2021, 7:42 AM