diff options
author | Carson Gross <carson@bigsky.software> | 2024-08-01 13:44:31 -0600 |
---|---|---|
committer | Carson Gross <carson@bigsky.software> | 2024-08-01 13:44:31 -0600 |
commit | a575ad20f0c3fef3785e234ff706e83a0a9bd4b4 (patch) | |
tree | 2ed56bd9d0178f05248478dca308919c024e63ae | |
parent | 115f2cf2108087802ee266b85ffa9987c929f84c (diff) | |
download | htmx-1cg/wdc_fixes.tar.gz htmx-1cg/wdc_fixes.zip |
use attributes rather than request count since we are working on a clone of the original DOM1cg/wdc_fixes
-rw-r--r-- | src/htmx.js | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/htmx.js b/src/htmx.js index bae509b8..1253f672 100644 --- a/src/htmx.js +++ b/src/htmx.js @@ -3060,11 +3060,8 @@ var htmx = (function() { 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'); - } + forEach(findAll(clone, '[data-disabled-by-htmx]'), function(child) { + child.removeAttribute('disabled'); }) return clone.innerHTML } @@ -3219,6 +3216,7 @@ var htmx = (function() { const internalData = getInternalData(disabledElement) internalData.requestCount = (internalData.requestCount || 0) + 1 disabledElement.setAttribute('disabled', '') + disabledElement.setAttribute('data-disabled-by-htmx', '') }) return disabledElts } @@ -3240,6 +3238,7 @@ var htmx = (function() { internalData.requestCount = (internalData.requestCount || 0) - 1 if (internalData.requestCount === 0) { disabledElement.removeAttribute('disabled') + disabledElement.removeAttribute('data-disabled-by-htmx') } }) } |