Closed NetheriteTree closed 4 years ago
first things first: can you put a console.log
in there to see if the event is firing properly?
no errors
it seems it is not firing properly
Looking at https://material-ui.com/, i think you are gonna have a pretty bad time with htmx.
htmx assumes there is a stable DOM to process at the end of a request. If you are slamming the DOM around with dynamically updating content, it won't add the right event handlers to the newly added content.
And I bet material-ui assumes it is loaded once and only once for an app.
This just seems like a painful direction to go to me.
Looking at https://material-ui.com/, i think you are gonna have a pretty bad time with htmx.
htmx assumes there is a stable DOM to process at the end of a request. If you are slamming the DOM around with dynamically updating content, it won't add the right event handlers to the newly added content.
And I bet material-ui assumes it is loaded once and only once for an app.
This just seems like a painful direction to go to me.
But I am not using this one, I use https://getmdl.io/ which provided by Google
Ah, OK. Looking at that, it looks like you need to call
componentHandler.upgradeElement(button);
on every element added to the DOM. This is probably best done with an extension that catches the processedNode.htmx
event and calls the above code on the element (maybe with a test for an mdl class?)
You can use the remove-me
extension as a template:
The material.min.js can't work after clicking a htmx link This is my sittings:
This is the material.min.js:
And other javascripts work perfectly