You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have set htmx.config.defaultSwapStyle = "outerHTML".
I expected multi-swap to use this as well but it defaults to "innerHTML". var elementSwapStyle = typeof (split[1]) !== 'undefined' ? split[1] : 'innerHTML'
Any reason for this behaviour?
Also, any reason the hx-swap is not sent as a header?
Thank you for taking the time
The text was updated successfully, but these errors were encountered:
Can't really tell as I wasn't there when it was written, one thing I can say is that if we were to change that default, it would be a breaking change, so for backwards compatibility concerns, we can't change it.
Though, note you could totally copy the extension locally and change the default value if you need it:
On another note, I personnally wouldn't recommend using this extension at all, as its premise is simply untrue:
OOB requires HTML tags marked with hx-swap-oob attributes to be at the TOP level of HTML, which significantly limited its use. With OOB, it's impossible to swap multiple elements arbitrarily placed and nested in the DOM tree.
That is actually false, and has been for 3 years.
I had removed that mention in the lib's doc last year but I totally forgot it was also mentioned here.
So for a very personal opinion, I'd suggest simply using oob swap instead and no extension at all for this matter.
Also, any reason the hx-swap is not sent as a header?
What would be the use of such header? Note that we don't send everything as headers, and new headers have been implemented over time as the community needed it, or suggested a usecase that felt relevant to us. So feel free to defend your opinion here, we can always be convinced. But we'll need more information about its usage!
I have set htmx.config.defaultSwapStyle = "outerHTML".
I expected multi-swap to use this as well but it defaults to "innerHTML".
var elementSwapStyle = typeof (split[1]) !== 'undefined' ? split[1] : 'innerHTML'
Any reason for this behaviour?
Also, any reason the hx-swap is not sent as a header?
Thank you for taking the time
The text was updated successfully, but these errors were encountered: