Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Properly remove request indicators #2860

Merged
merged 2 commits into from
Oct 3, 2024

Conversation

aeccue
Copy link
Contributor

@aeccue aeccue commented Sep 1, 2024

Description

Bug:
When htmx-request is placed on the same element that is disabled by hx-disabled-elt request count is increased twice on the same element. However, when removing request indicators, the request counts for indicators and disabled elements are deducted separately. This meant that when checking the indicators, request count would not be 0, and htmx-reqest is not properly removed.

Solution:
Deduct request counts first for both indicators and disabled elements, before removing request indicators.

Corresponding issue: #2295 #2234
Also in extensions repo: bigskysoftware/htmx-extensions#79

Testing

Tested with a personal project as well as using the sample code provided in the issues.

Checklist

  • I have read the contribution guidelines
  • I have targeted this PR against the correct branch (master for website changes, dev for
    source changes)
  • This is either a bugfix, a documentation update, or a new feature that has been explicitly
    approved via an issue
  • I ran the test suite locally (npm run test) and verified that it succeeded

@Telroshan Telroshan added bug Something isn't working ready for review Issues that are ready to be considered for merging labels Sep 1, 2024
@Telroshan Telroshan force-pushed the fix/properly-remove-htmx-request branch from 1d47426 to 5a484c5 Compare September 1, 2024 19:02
@Telroshan
Copy link
Collaborator

(Note: I just rebased your PR against dev to get the latest commit that fixes the CI, as your PR had nothing to do with those failing tests!)

@aeccue
Copy link
Contributor Author

aeccue commented Sep 2, 2024

@Telroshan Thanks so much!

@1cg 1cg merged commit c24adef into bigskysoftware:dev Oct 3, 2024
1 check failed
@nikalexis
Copy link

I tried version 2.0.3, but it is not solving the issue. Is it working for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ready for review Issues that are ready to be considered for merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants