user
10/19/2021, 5:25 PMbig-airline-13935
10/19/2021, 9:24 PMmicroscopic-city-7951
10/20/2021, 1:29 PMmost-jelly-15242
10/20/2021, 1:35 PMHX-Push header https://htmx.org/reference/#response_headers and you can also do it on the client side via htmx-push-url https://htmx.org/attributes/hx-push-url/microscopic-city-7951
10/20/2021, 1:55 PMmicroscopic-city-7951
10/20/2021, 1:55 PMmysterious-toddler-20573
10/20/2021, 2:03 PMhx-push-url that updated the local URL appropriately or relied on the server to return the correct URL in an HX-Push headermost-jelly-15242
10/20/2021, 2:28 PMmicroscopic-city-7951
10/20/2021, 6:41 PMmicroscopic-city-7951
10/20/2021, 7:09 PMgorgeous-airport-54386
10/20/2021, 7:10 PMmost-jelly-15242
10/20/2021, 7:53 PMhx-push-url. If that's an option you could try to manage it with events.microscopic-city-7951
10/20/2021, 7:55 PMgorgeous-airport-54386
10/20/2021, 7:55 PMmicroscopic-city-7951
10/20/2021, 7:55 PMmicroscopic-city-7951
10/20/2021, 7:56 PMlate-king-98305
10/20/2021, 8:54 PMdata attribute to hold that ID. Then, I use Bootstrap's example at https://getbootstrap.com/docs/5.0/components/modal/#varying-modal-content (the event handler) to set the href of the link, or the hx-get of the button, to call the right URL. It's also decorated with hx-boost.
What I'm seeing is that, if it's a link, it navigates the browser there; it doesn't get boosted. If it's a button, I can make it work, but instead of loading the URL I set when the modal was shown, it loads a copy of the same page the modal is on. It's almost like the boosting may be being done when the page is initially rendered, but not picking up when I change the target URL. Does that sound like it makes sense? And, if so, I very well could be "doing it wrong," so feel free to suggest alternate approaches. (Maybe load the modal but have it get the guts from the server via hx-load? But I've still got to set the ID somewhere, or the update / note retrieval part won't know which of the cards it's being called against.)late-king-98305
10/21/2021, 1:22 PMhx-get on the button that launches the modal, targeting the body of the modal; then, I return the HTML fragment from the server. All the htmx stuff works like it should again. πbillions-microphone-84331
10/21/2021, 3:38 PMnpm and frontend build steps as much as possible? If so, what CSS framework do you guys use (and do you use any)?
I really like the design of tailwindcss, but it bothers me a lot that I need npm to take full advantage of it (apply the postcss configuration, use the "apply" directive to wrap components, and so on). I tend to like simple CDN imports nowadays.
What is your strategy for this? Is there a utility-first CSS library that is in the wild without a js build/preprocessor? I donβt specifically hate preprocessors but at least I donβt like having a javascript pipeline to build my frontend assets. Maybe I "just" need to rewrite the tailwind preprocessor using my backend language πsparse-musician-64201
10/21/2021, 3:51 PMsparse-musician-64201
10/21/2021, 3:51 PMnumerous-leather-81181
10/21/2021, 3:55 PM<div hx-post="...url..."
hx-trigger="change target:input[name='one_thing']"
hx-trigger="change target:input[name='another_thing']"
hx-swap="outerHTML" hx-target="this">
but I couldn't get that to work, trying various variations including "change target:input[name='a'], change target:input[name='b']" and other variants. In the end I gave up and just used hx-trigger="change target:input[type='checkbox']" which worked because all the controls I needed to watch were checkboxes. That "overselected" because I have some checkboxes that don't need this, but that's survivable. Now my problem is that I have other controls that are not type='checkbox' so I'm back to my original problem:
How can I use hx-trigger to target multiple form elements?stocky-dentist-80693
10/21/2021, 4:12 PMchange target ref?numerous-leather-81181
10/21/2021, 4:19 PMnumerous-leather-81181
10/21/2021, 4:20 PMstocky-dentist-80693
10/21/2021, 4:22 PMnumerous-leather-81181
10/21/2021, 4:22 PMnumerous-leather-81181
10/21/2021, 4:34 PM<div id="htmx-container" hx-post="...url..."
hx-trigger="change target:input[name='one_thing']"
hx-swap="outerHTML" hx-target="this">
<div hx-post="...url..."
hx-trigger="change target:input[name='another_thing']"
hx-swap="outerHTML" hx-target="#htmx-container">
Good enough to get by, but not as tidy as a multi-target syntax might me.mysterious-toddler-20573
10/21/2021, 5:24 PMhtml
<div hx-post="...url..."
hx-trigger="change[target.name=='one_thing' || target.name='another_thing']"
hx-swap="outerHTML" hx-target="this">
...mysterious-toddler-20573
10/21/2021, 5:24 PMtarget becomes event.target ) and then against the global namespace