mysterious-toddler-20573
09/15/2020, 4:17 PMdev
but never made it out into the wild, if you have hyperscript that isn't on an element with an hx-
attributemysterious-toddler-20573
09/15/2020, 4:17 PMgorgeous-ghost-95789
09/15/2020, 5:54 PMmysterious-toddler-20573
09/15/2020, 5:56 PMmysterious-toddler-20573
09/15/2020, 5:58 PMmysterious-toddler-20573
09/15/2020, 5:58 PMgorgeous-ghost-95789
09/15/2020, 6:04 PMmysterious-toddler-20573
09/15/2020, 6:32 PMmysterious-toddler-20573
09/15/2020, 6:32 PMmysterious-toddler-20573
09/15/2020, 6:33 PMhtml
<div hx-sse="connect:/foo swap:bar">...</div>
gorgeous-ghost-95789
09/15/2020, 7:02 PMgorgeous-ghost-95789
09/15/2020, 7:03 PMgorgeous-iron-50959
09/16/2020, 12:12 PMmysterious-toddler-20573
09/16/2020, 1:39 PMmysterious-toddler-20573
09/16/2020, 1:39 PMpowerful-plumber-39972
09/17/2020, 10:38 AMdispatchEvent(new Event("change"))
on a form input element with HTMX attributes describing the request I want to make.
This basically works, but there's a quirk. If I trigger this programatic request before triggering the form field manually, then my CSS transitions aren't working properly on the loaded content. However the transitions do work correctly when I trigger the form field manually, or when I trigger the form field programatically after a previous manual interaction.
Wondering if there's some HTMX initialisation code that is being run when triggered manually but not from my programatic event dispatch? Is there a best practice for triggering HTMX from custom events?big-airline-13935
09/17/2020, 11:09 AMhtmx:beforeRequest
(https://htmx.org/events/#htmx:beforeRequest) event and set the parameter then, or use hx-vars
(https://htmx.org/attributes/hx-vars/) which can compute an expression.millions-apartment-38225
09/17/2020, 2:06 PMmysterious-toddler-20573
09/17/2020, 3:46 PMmysterious-toddler-20573
09/17/2020, 3:47 PMmysterious-toddler-20573
09/17/2020, 8:12 PMmysterious-toddler-20573
09/17/2020, 8:12 PMwooden-wall-85896
09/17/2020, 8:17 PMbig-airline-13935
09/17/2020, 9:18 PMmysterious-toddler-20573
09/17/2020, 9:41 PMmillions-apartment-38225
09/18/2020, 11:38 AMmysterious-toddler-20573
09/18/2020, 12:22 PMmillions-apartment-38225
09/18/2020, 12:34 PMpowerful-plumber-39972
09/18/2020, 1:30 PMhtmx:beforeRequest
(https://htmx.org/events/#htmx:beforeRequest) event and set the parameter then, or use hx-vars
(https://htmx.org/attributes/hx-vars/) which can compute an expression.
@User Thanks, I'll check that out.mysterious-toddler-20573
09/18/2020, 1:41 PM