Skip to content

Commit c24adef

Browse files
aeccue1cg
andauthored
[FIX] Properly remove request indicators (#2860)
Deduct request count before removing request indicators Co-authored-by: 1cg <[email protected]>
1 parent 0e1eeec commit c24adef

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/htmx.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3269,16 +3269,18 @@ var htmx = (function() {
32693269
* @param {Element[]} disabled
32703270
*/
32713271
function removeRequestIndicators(indicators, disabled) {
3272+
forEach(indicators.concat(disabled), function(ele) {
3273+
const internalData = getInternalData(ele)
3274+
internalData.requestCount = (internalData.requestCount || 1) - 1
3275+
})
32723276
forEach(indicators, function(ic) {
32733277
const internalData = getInternalData(ic)
3274-
internalData.requestCount = (internalData.requestCount || 1) - 1
32753278
if (internalData.requestCount === 0) {
32763279
ic.classList.remove.call(ic.classList, htmx.config.requestClass)
32773280
}
32783281
})
32793282
forEach(disabled, function(disabledElement) {
32803283
const internalData = getInternalData(disabledElement)
3281-
internalData.requestCount = (internalData.requestCount || 1) - 1
32823284
if (internalData.requestCount === 0) {
32833285
disabledElement.removeAttribute('disabled')
32843286
disabledElement.removeAttribute('data-disabled-by-htmx')

0 commit comments

Comments
 (0)