summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorCarson Gross <carson@bigsky.software>2024-08-01 12:59:42 -0600
committerCarson Gross <carson@bigsky.software>2024-08-01 12:59:42 -0600
commit115f2cf2108087802ee266b85ffa9987c929f84c (patch)
tree8be0a97f0010971ffd8583e4821099f32328520c
parent116c8619d5e6301e8df71f0d3caf32e8660b9096 (diff)
downloadhtmx-115f2cf2108087802ee266b85ffa9987c929f84c.tar.gz
htmx-115f2cf2108087802ee266b85ffa9987c929f84c.zip
remove `disabled` attributes from anything disabled due to an htmx request when snapshotting for history
-rw-r--r--src/htmx.js7
1 files changed, 7 insertions, 0 deletions
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
}