improve hx-boost advanced config to use new mergeConfig for nesting (#3572)

improve hx-boost advanced config to use new mergeConfig for nesting support

Co-authored-by: MichaelWest22 <michael.west@docuvera.com>
This commit is contained in:
MichaelWest22
2025-12-05 07:45:54 +13:00
committed by GitHub
parent 0bb59973f8
commit 757bd19fea

View File

@@ -325,9 +325,12 @@ var htmx = (() => {
credentials: "same-origin",
signal: ac.signal,
mode: this.config.mode
},
...sourceElement._htmx?.boosted
}
};
// Apply boost config overrides
if (sourceElement._htmx?.boosted) {
this.__mergeConfig(sourceElement._htmx.boosted, ctx);
}
ctx.target = this.__resolveTarget(sourceElement, ctx.target);
// Apply hx-config overrides
@@ -1006,7 +1009,7 @@ var htmx = (() => {
__maybeBoost(elt) {
let boostValue = this.__attributeValue(elt, "hx-boost");
if (boostValue && boostValue !== "false" && this.__shouldBoost(elt)) {
elt._htmx = {eventHandler: this.__createHtmxEventHandler(elt), requests: [], boosted: this.__parseConfig(boostValue)}
elt._htmx = {eventHandler: this.__createHtmxEventHandler(elt), requests: [], boosted: boostValue}
elt.setAttribute('data-htmx-powered', 'true');
if (elt.matches('a') && !elt.hasAttribute("target")) {
elt.addEventListener('click', (click) => {