mirror of
https://github.com/bigskysoftware/htmx.git
synced 2025-09-29 05:51:39 +00:00
ignore overridden default swap style for hx-boost
fixes https://github.com/bigskysoftware/htmx/issues/342
This commit is contained in:
parent
5836e2365e
commit
1a6f9b1ae5
@ -1749,7 +1749,7 @@ return (function () {
|
||||
function getSwapSpecification(elt) {
|
||||
var swapInfo = getClosestAttributeValue(elt, "hx-swap");
|
||||
var swapSpec = {
|
||||
"swapStyle" : htmx.config.defaultSwapStyle,
|
||||
"swapStyle" : getInternalData(elt).boosted ? 'innerHTML' : htmx.config.defaultSwapStyle,
|
||||
"swapDelay" : htmx.config.defaultSwapDelay,
|
||||
"settleDelay" : htmx.config.defaultSettleDelay
|
||||
}
|
||||
|
@ -57,5 +57,19 @@ describe("hx-boost attribute", function() {
|
||||
})
|
||||
|
||||
|
||||
it('overriding default swap style does not effect boosting', function () {
|
||||
htmx.config.defaultSwapStyle = "afterend";
|
||||
try {
|
||||
this.server.respondWith("GET", "/test", "Boosted");
|
||||
var a = make('<a hx-target="this" hx-boost="true" id="a1" href="/test">Foo</a>');
|
||||
a.click();
|
||||
this.server.respond();
|
||||
a.innerHTML.should.equal("Boosted");
|
||||
} finally {
|
||||
htmx.config.defaultSwapStyle = "innerHTML";
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user