Matteo Smaila b0c87bf363
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>
2025-07-14 17:37:40 -06:00
..
2020-05-16 14:30:25 -07:00
2024-01-13 14:17:52 -05:00
2023-12-13 14:59:48 -07:00