bigskysoftware / bigskysoftware/_hyperscript

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

Abierto
#643 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
JavaScript
Estrellas
3.8k
Forks
172
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Comienza reproduciendo la secuencia indicada: una tabla cargada mediante HTMX, enlaces hx-boosted, navegación a otra página y el botón de volver del navegador. Observa si el load event se dispara mientras la tabla almacenada en caché está visible y determina el punto de entrada del proyecto responsable. Se considera terminado cuando la tabla no se vuelve a cargar innecesariamente al navegar hacia atrás, pero sigue cargándose en una carga inicial real.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
javascript
Área
frontend, web-dev
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.