diff --git a/src/htmx.js b/src/htmx.js index 4eca86683..3a9309a08 100644 --- a/src/htmx.js +++ b/src/htmx.js @@ -483,6 +483,8 @@ return (function () { function swap(swapStyle, elt, target, fragment, settleInfo) { switch (swapStyle) { + case "none": + return; case "outerHTML": swapOuterHTML(target, fragment, settleInfo); return; diff --git a/test/attributes/hx-swap.js b/test/attributes/hx-swap.js index 2e484b45a..e8a4ae749 100644 --- a/test/attributes/hx-swap.js +++ b/test/attributes/hx-swap.js @@ -246,7 +246,6 @@ describe("hx-swap attribute", function(){ }, 30); }); - it('swap outerHTML properly w/ data-* prefix', function() { this.server.respondWith("GET", "/test", 'Click Me'); @@ -262,5 +261,14 @@ describe("hx-swap attribute", function(){ byId("a1").innerHTML.should.equal('Clicked!'); }); + it('swap none works properly', function() + { + this.server.respondWith("GET", "/test", 'Ooops, swapped'); + + var div = make('