bigskysoftware / bigskysoftware/_hyperscript

Load event also fires on back button when previous page is still available

Aperta
#643 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
3.8k
Fork
172
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

I have a table that has a header that listens for a `load` event to fetch its contents using HTMX. The table is then full of links that are `hx-boost`ed.

When these links are clicked, they navigate to a new page. Now, when pressing the back button, the table is still visibly loaded/the page has been cached (on first load the table is blank), but the `load` event is refired and the table is unnecessarily re-fetched.

Is there a way to filter these out and only fetch the table on "true" loads?

https://github.com/user-attachments/assets/7554133d-4c8b-4ef4-b6a7-71529b703a5d

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Start by reproducing the reported sequence: an HTMX-loaded table, hx-boosted links, navigation to another page, and the browser back button. Observe whether the load event fires while the cached table is visible and determine the project entry point responsible. Done means the table is not unnecessarily refetched on back navigation while still loading on a true initial load.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript
Ambito
frontend, web-dev
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.