SIGN IN SIGN UP
bigskysoftware / htmx UNCLAIMED

</> htmx - high power tools for HTML

0 0 21 JavaScript

Bugfix: swap="outerHTML" on <div> with style attribute leaves htmx-swapping class behind (#3341)

* Added regression test for swap=outerHTML unexpected behavior, checked it failes, implemented initial fix in htmx.js that makes (all) test(s) run and pass.

* Renamed variable in my regression test to be more clear.

* I noticed I wasn't using the copies of the attributes I introduced.Tests were passing and I know why, though. This means I miss one more regression test for the bug in cloneAttributes.

* Added one more regression test for the fix in cloneAttributes.

* Made preservation of htmx- prefixed classes more robust in cloneAttributes after I noted they could as well be removed by mergeTo.setAttribute in the second forEach loop.

* Started as a typo-fix, ended up renaming regression tests to be more explicit.

* Started as a typo-fix, ended up renaming regression tests to be more explicit.

* Removed space that I accidentally added before.

* Applied changes as requested by MichaelWest22.

---------

Co-authored-by: Matteo Smaila <matteo.smaila@314softwaresolutions.com>
Co-authored-by: 1cg <469183+1cg@users.noreply.github.com>
M
Matteo Smaila committed
b0c87bf3635209b5dd34c2b954d61bda58db8670
Parent: 7529444
Committed by GitHub <noreply@github.com> on 7/14/2025, 11:37:40 PM