Open chmp opened 11 months ago
The fact that it works nicely with htmx certainly is a plus.
I don't have that much time anymore (I have a 1 year old now) but I'd love to revisit this on the medium term. If you have an idea for a PR I'm all ears ... but a few concerns:
Okay, I realized I'm also bit swamped at the moment - hence the delay :)
I hacked together an implementation in #4 and hosted a demo here - as always with htmx you can see the details with "show source".
To your points:
Hi @koaning,
Really cool idea. That reminds of a similar setup I use. In principle the functionality is the same, but I use custom elements. I beleive they have a couple of advantages over the "onload" event:
That's the snippet I'm using:
To react to changes to the element after it has been aded to the DOM, you probably would need to use a MutationObserver. Something along the lines of this:
Feel free to ignore my suggestion. Happy to whip up a PR, if you're intested (although the first code snippet should be mostly it :D).