some-airline-73512
11/28/2022, 12:19 PMdefineExtension
on freshly swapped nodes. As a result, no extension works on these nodes. I found this on preload extension, but it's a bug in htmx core.mysterious-toddler-20573
11/28/2022, 1:51 PMdefinedExtension
called?white-motorcycle-95262
11/28/2022, 4:00 PMcursor: not-allowed;
and pointer-events: none;
?
I'm not opposed to using hyperscript, just was hoping to have it all defined in one place, instead of creating a behavior and then finding all the buttons and installing it, etc. Just trying to avoid double HTMX submits.
EDIT: Looks like just setting pointer-events: none
suffices and prevents future HTMX calls while the initial one is being processed, although you can't have both that and cursor: not-allowed
on the same element (although I suppose you could but the cursor css on a wrapper div).some-airline-73512
11/28/2022, 5:30 PMhtml
<head><script src="https://cdn.jsdelivr.net/npm/htmx.org@1.8.4/dist/ext/preload.js"></script></head>
And then the script calls:
javascript
htmx.defineExtension("preload", {.....
mysterious-toddler-20573
11/28/2022, 5:34 PMsome-airline-73512
11/28/2022, 6:07 PMwhite-motorcycle-95262
11/28/2022, 6:11 PMhtmx.defineExtension
located?
EDIT: I might have misunderstood. Is htmx.defineExtension
a part of preload.js
?mysterious-toddler-20573
11/28/2022, 6:16 PMmysterious-toddler-20573
11/28/2022, 6:16 PMmysterious-toddler-20573
11/28/2022, 6:16 PMhx-ext
attributemysterious-toddler-20573
11/28/2022, 6:17 PMsome-airline-73512
11/28/2022, 6:52 PMsome-airline-73512
11/28/2022, 6:54 PMhundreds-camera-24900
11/28/2022, 7:09 PMhundreds-camera-24900
11/28/2022, 7:09 PMhundreds-camera-24900
11/28/2022, 7:09 PMwhite-motorcycle-95262
11/28/2022, 7:29 PM{'hx-get': 'my_value'}
? What are you using to render HTML?hundreds-camera-24900
11/28/2022, 7:29 PMhundreds-camera-24900
11/28/2022, 7:29 PMhundreds-camera-24900
11/28/2022, 7:30 PM{{mymacro(attrs={'hx-get': 'my_value'})}}
hundreds-camera-24900
11/28/2022, 7:30 PMhundreds-camera-24900
11/28/2022, 7:30 PM{{mymacro( hx-get='my_value' )}}
white-motorcycle-95262
11/28/2022, 7:37 PM{'hx_get': 'my_value'}
and then possibly do something like
<div
id="myId"
{% if hx_get %}
hx-get="{{ hx_get }}"
{% elif hx_post %}
hx-post="{{ hx_post }}"
{% endif %}
></div>
But that's more rough than specifying attrs
in your case so 🤷hundreds-camera-24900
11/28/2022, 7:59 PMhundreds-camera-24900
11/28/2022, 7:59 PMhundreds-camera-24900
11/28/2022, 8:00 PMwhite-motorcycle-95262
11/28/2022, 8:21 PMdelightful-candle-13758
11/28/2022, 8:44 PMancient-shoe-86801
11/28/2022, 9:19 PMHX-Request=true
header (htmx adds that header by default) = partial page, without most of the boilerplate that is "static" like header, footer, etc.boundless-vase-80440
11/28/2022, 9:21 PM