bitter-machine-55943
10/23/2022, 10:06 PMboundless-vase-80440
10/23/2022, 10:19 PMeager-agency-92101
10/23/2022, 11:48 PMhtml
# version 1.1
<div>
Click and see a RED button
<button hx-get="/click" hx-trigger="click" hx-swap="outerHTML">
A button
</button>
</div>
# url /click returns
<button hx-get="/click" hx-swap="outerHTML" style="color: red">
I am red
</button>
Later, a new version 1.2 has been release to public
html
# version 1.2
<div>
Click and see a Blue button
<button hx-get="/click" hx-trigger="click" hx-swap="outerHTML">
A button
</button>
</div>
# url /click returns
<button hx-get="/click" hx-swap="outerHTML" style="color: blue">
I am blue
</button>
The user who is on 1.1 cicked the button and the blue button(version 1.2) is sent and resulted in the wrong expectation.
How would we overcome this problem?brainy-ice-92385
10/23/2022, 11:50 PMeager-agency-92101
10/23/2022, 11:53 PMeager-agency-92101
10/23/2022, 11:54 PMbrainy-ice-92385
10/23/2022, 11:55 PMeager-agency-92101
10/23/2022, 11:56 PMbrainy-ice-92385
10/23/2022, 11:59 PMeager-agency-92101
10/24/2022, 12:01 AMvictorious-match-64854
10/24/2022, 12:14 AMvictorious-match-64854
10/24/2022, 12:14 AMmysterious-toddler-20573
10/24/2022, 2:01 AMbitter-machine-55943
10/24/2022, 2:33 AMhead-support
, I noticed there’s a <style>
tag that gets added for .htmx-indicator
which seems to be dynamically added. If I mark all of the <head>
contents with hx-preserve=“true”
, that <style>
tag gets removed the first time a head swap occurs. That’s as expected, but may not be what someone wants.
Makes me wonder if there should be a way to default everything to hx-preserve=“true”
prior to any head swaps, and allow setting hx-preserve=“false”
(or similar) so that the page-specific stuff that got swapped into head doesn’t remain after subsequent head swaps.mysterious-toddler-20573
10/24/2022, 2:38 AMmysterious-toddler-20573
10/24/2022, 2:38 AMmysterious-toddler-20573
10/24/2022, 2:38 AMsalmon-xylophone-28580
10/24/2022, 6:30 AMripe-action-67367
10/24/2022, 6:48 AMripe-action-67367
10/24/2022, 6:50 AMripe-action-67367
10/24/2022, 6:52 AMsalmon-xylophone-28580
10/24/2022, 7:17 AMoutput
tag. Never seen it before. Thank you.boundless-leather-51644
10/24/2022, 8:19 AMboundless-leather-51644
10/24/2022, 8:19 AMtall-dinner-62086
10/24/2022, 8:20 AMboundless-leather-51644
10/24/2022, 8:49 AMicy-analyst-57034
10/24/2022, 9:13 AMhtml
<form
hx-post="/some-url"
hx-confirm="Are you sure you want to do the action?"
hx-trigger="confirm delay:500ms"
>
<button>Do Action</button>
</form>
I'm trying to get the delay to be after the confirm message has been OK'd, but I'm not having any luck with it. Any help would be appreciated 🙂boundless-leather-51644
10/24/2022, 11:00 AMboundless-leather-51644
10/24/2022, 11:00 AMminiature-lizard-24702
10/24/2022, 11:05 AM