bigskysoftware / bigskysoftware/htmx-extensions

loading-states are persisted for preloaded requests

Open
#182 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
284
Forks
88
PR merge metrics
No merged PRs in 30d

Description

When using the loading-states extension with the preload extension, loading states are triggered by the preloaded requests, but the preloaded requests do not undo the loading states. This causes loading states to persist even after the request has completed.

This is caused by preloaded requests firing htmx:beforeRequest which triggers the loading state, but preloaded requests do not trigger htmx:beforeOnLoad which is used to undo the loading state in loading-states.

This is replicated by:
```html




[data-loading] { display: none; }


Mouse over to preload

Loading...

```

As preloaded requests are not intentionally initiated by the user and not necessarily needed, I suggest that preloaded requests should not trigger loading states at all.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.