Skip to content

help understanding HTMX behavior and JS #1158

Answered by David-Guillot
bfallik asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @bfallik ,

It all depends on how JS events listeners are bound to DOM elements.

Flowbite source code for dismiss component contains an initDismiss() function that is bound to DOMContentLoaded event. So it doesn't get called when htmx loads an HTML fragment.

What you can do is plug a call to that function from the htmx:load event.

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
4 replies
@bfallik
Comment options

@CleitonDeLima
Comment options

@vkgautham
Comment options

@David-Guillot
Comment options

Answer selected by bfallik
Comment options

You must be logged in to vote
2 replies
@David-Guillot
Comment options

@junctionapps
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants