gorgeous-ghost-95789
01/05/2022, 4:51 AMpowerful-evening-99811
01/05/2022, 4:52 AMgorgeous-ghost-95789
01/05/2022, 4:52 AMpowerful-evening-99811
01/05/2022, 4:53 AMgorgeous-ghost-95789
01/05/2022, 4:53 AMgorgeous-ghost-95789
01/05/2022, 4:55 AMpowerful-evening-99811
01/05/2022, 4:56 AMhx-sse="connect:/events/results?search={{.search}} such that it works as expected.powerful-evening-99811
01/05/2022, 5:20 AM<div _='on load put ("connect:/events/results?search=" + #search.value + " swap:message") into my @hx-sse then call htmx.process(me)' hx-swap="beforeend">
...loading
</div>powerful-evening-99811
01/05/2022, 6:00 AM<div id="stream" _='
eventsource Thing
on message
append it to #stream
end
end
on load or keyup from #search debounced at 500ms
put "" into me then
call Thing.open("/events/results?search=" + #search.value)
'>silly-van-66718
01/05/2022, 6:15 AMsilly-van-66718
01/05/2022, 6:21 AMpowerful-evening-99811
01/05/2022, 6:22 AMsilly-van-66718
01/05/2022, 6:26 AMsilly-van-66718
01/05/2022, 6:55 AMsilly-van-66718
01/05/2022, 6:55 AMsilly-van-66718
01/05/2022, 6:58 AMsilly-van-66718
01/05/2022, 7:01 AMmost-jelly-15242
01/05/2022, 12:27 PMhtmx:configRequest event https://htmx.org/events/#htmx:configRequest by changing the event.detail.path value. So in that event you can read the date and add it to the path or you can also add it as a parameter in evt.detail.parametersuser
01/05/2022, 12:36 PMuser
01/05/2022, 12:37 PMmysterious-toddler-20573
01/05/2022, 2:47 PMmysterious-toddler-20573
01/05/2022, 2:47 PMmysterious-toddler-20573
01/05/2022, 2:47 PMmysterious-toddler-20573
01/05/2022, 2:47 PMmysterious-toddler-20573
01/05/2022, 2:48 PMadamant-exabyte-92636
01/05/2022, 3:35 PMcalm-ice-23682
01/05/2022, 3:36 PMmost-jelly-15242
01/05/2022, 3:36 PMhtmx:configRequest event for a long time to make the path dynamic by changing the event.detail.path value and that works great for me. The use case is that I send all the htmx requests to the same URL in Joomla and WordPress which is a long ugly URL, but in hx-get I just have a simple value which I use to generate the dynamic URL.most-jelly-15242
01/05/2022, 3:39 PMhx-get="increment", that value is read and used in event.detail.path which looks something like `index.php?option=something&component=counter/increment"fresh-controller-36545
01/05/2022, 4:25 PMmain-content div in hx-boost - main issue here is also wanting to use more elaborated htmx fragments within the main-content, like so
html
<div id="main-content-wrapper"
hx-boost="true"
hx-select="#main-content"
hx-target="#main-content"
hx-swap="outerHTML show:window:top"
hx-push-url="true">
<div id="main-content">
<div id="unique-snowflake"
hx-get="/xapi/snow/"
hx-target="#unique-snowflake">
`/xapi/snow/` returns a fragment that's just the `<div id="unique-snowflake">...`
This will just be emptied, as the auto-inheritance of the `hx-boost`-wrapper will
try to select `#main-content` in the response body.
</div>
</div>
<div>
You could of course define hx-select="unset" on the #unique-slowflake-div, but I could imagine having to do that on every child-node wouldn't scale well, instead of just being able to define e.g. <div id="main-content-wrapper" hx-inherit="false">
Wrapping #main-content in yet another div definitely disables the inheritance, but then results in the original hx-boost in not working - <div hx-select="unset" hx-target="unset" hx-swap="unset">