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

loading-states extension ignores path filter on htmx:beforeOnLoad when multiple requests are in flight #2296

Open
rekado opened this issue Feb 9, 2024 · 0 comments

Comments

@rekado
Copy link

rekado commented Feb 9, 2024

The loading-states extension queues up callbacks on htmx:beforeRequest. On htmx:beforeOnLoad it executes any undo callbacks that mayProcessUndoCallback allows. mayProcessUndoCallback only checks for the existence of the target.

Suppose we have multiple requests in flight. We use data-loading-path to only have matching requests modify the loading states of target elements. While attaching loading states can be filtered, removing loading states always succeeds as the undo queue is drained on htmx:beforeOnLoad.

This means that target elements are marked as loaded even though their requests are still in flight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant