diff --git a/src/htmx.js b/src/htmx.js
index 83caa151e..6fefab83a 100644
--- a/src/htmx.js
+++ b/src/htmx.js
@@ -1161,6 +1161,7 @@ var htmx = (() => {
let targetSelector = this.__attr(templateElt, 'hx-target') || (templateElt.id ? '#' + CSS.escape(templateElt.id) : null);
if (targetSelector) {
this.__processScripts(templateElt.content);
+ tasks.push(...this.__processOOB(templateElt.content, ctx.sourceElement));
let swapSpec = this.__parseSwapSpec(this.__attr(templateElt, 'hx-swap') || this.config.defaultSwap);
if (swapSpec.ignoreTitle) ctx.title = null;
let targets = this.__findAllExt(ctx.sourceElement, targetSelector);
diff --git a/test/tests/attributes/hx-swap-oob.js b/test/tests/attributes/hx-swap-oob.js
index 9c7dd818b..dcbe158e1 100644
--- a/test/tests/attributes/hx-swap-oob.js
+++ b/test/tests/attributes/hx-swap-oob.js
@@ -24,6 +24,16 @@ describe('hx-swap-oob', function() {
assertTextContentIs('#oob2', 'New Inner')
})
+ it('swaps an oob element out of an hx-partial', async function () {
+ mockResponse('GET', '/test', ' New content