bigskysoftware / bigskysoftware/_hyperscript

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

未关闭
#643 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
JavaScript
星标
3.8k
派生
172
PR 合并指标
30 天内没有已合并 PR

描述

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

贡献指南

这个仓库没有索引到贡献指南

调研方向

首先重现报告中的操作序列:一个由 HTMX 加载的表格、hx-boosted 链接、导航到另一个页面,以及浏览器的后退按钮。观察缓存的表格可见时是否会触发 load event,并确定负责此行为的项目入口点。完成标准是:返回导航时表格不会被不必要地重新获取,同时在真正的初始加载时仍会加载。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript
领域
frontend, web-dev
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。