bigskysoftware / htmx-extensions

167 stars 51 forks source link

Preload Ext adds loading styles to loaded elements #110

Open infuzu-yidisprei opened 5 days ago

infuzu-yidisprei commented 5 days ago

If you use the htmx indicator attribute where basically it puts a special class on something and this is very useful to indicate a spinner/throbber for a loading state when a request is in progress.

The issue is that the preload extension puts those styles on the appropriate indicator too early. My specific use case is that I put preload="mouseover" on some get elements. Normally, i use the hx-indicator to put a spinning icon on the element that will be changed to indicate that element will be changed. With preload, it puts that indicator on after I hover over it, even if I don't end up clicking.