Why do camel-case events not work when using Alpine.js? #2843
Unanswered
danielniccoli
asked this question in
Q&A
Replies: 0 comments
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.
-
I am using both, HTMX and Alpine.js. I added
hx-on:htmx:afterSwap="console.log('boop')"to an element and it doesn't work. When replacing the camel-case with kebap-casehx-on:htmx:after-swap="console.log('boop')"the event is now handled as expected.I understand that both events are always fired. And that AlpineJS requires kebap-case ("This facilitates interoperability with other libraries. Alpine.js, for example, requires kebab case."). But I'm using HTMX's event handler (
hx-on) and not Alpine.js' (x-on). So why does the HTMX event handler not handle theafterSwapevent?Is this behaviour expected?
Beta Was this translation helpful? Give feedback.
All reactions