From 115f2cf2108087802ee266b85ffa9987c929f84c Mon Sep 17 00:00:00 2001 From: Carson Gross Date: Thu, 1 Aug 2024 12:59:42 -0600 Subject: [PATCH] remove `disabled` attributes from anything disabled due to an htmx request when snapshotting for history --- src/htmx.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/htmx.js b/src/htmx.js index 592126e9..bae509b8 100644 --- a/src/htmx.js +++ b/src/htmx.js @@ -3059,6 +3059,13 @@ var htmx = (function() { forEach(findAll(clone, '.' + className), function(child) { removeClassFromElement(child, className) }) + // remove the disabled attribute for any element disabled due to an htmx request + forEach(findAll(clone, '[disabled]'), function(child) { + const internalData = getInternalData(child) + if (internalData.requestCount > 0) { + child.removeAttribute('disabled'); + } + }) return clone.innerHTML }