Replies: 1 comment
-
This is tricky...since right now Alpine uses the element to assign its state (and htmx does too) which is not good, for either of them. And Alpine just copies all of them over to the new element as the way to "preserve" the changes Alpine has made... which naturally is an issue. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Issue Description:
I’m encountering an issue where POST requests configured to trigger on load are not firing after an Alpine Morph-based swap.
Reproduction:
🔗 Demo: JSFiddle
Steps to Reproduce:
Expected Behavior:
The newly swapped element should trigger a POST request since it has hx-post with trigger as load.
Current Behavior:
Findings:
HTMX’s latest version stores internal data (reference),
which carries over to the newly swapped element when using morph.
Is there a workaround or a potential fix for this behavior?
NOTE: This is happening only in the latest version of HTMX (v2.0.4)
Beta Was this translation helpful? Give feedback.
All reactions