Hyperscript behavior ceases to work after active search
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 38/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript
调研方向
先从表单的 _="install CheckBoxDataGrid" 行为和 issue 中描述的 <tbody> 替换开始,然后重现活动搜索的切换。验证替换后复选框点击处理程序仍会触发并记录 clicked checkbox;当该行为在新行上继续正常工作时,issue 即得到解决。
由索引模型根据 Issue 内容生成。
描述
I'm using hyperscript 0.9.14. I have a table of data in a form, with the first column in each row being a checkbox. There is a behavior defined in a .hs file and installed on the
tag. Users can filter the contents of the table through an active search feature. This is implemented in HTMX and it swaps the tag out for new HTML based on the results of the search. The issue is that the behavior reacts to events correctly on the page's first load, but ceases to work following a search.Is there a way to reassert a behavior following a change to a page's DOM?
<form hx-swap="none" _="install CheckBoxDataGrid">
<table>
<thead>
<tr>
<th>
My checkbox
</th>
</tr>
</thead>
<tbody id="key-aur-inf-res"> <!-- active search swaps this out -->
<tr>
<td>
<input type="checkbox" name="key-aur-mod-aauk-id" value="261">
</td>
</tr>
</tbody>
</table>
</form>
behavior CheckBoxDataGrid
on click from <input[name="key-aur-mod-aauk-id"] /> in me
log 'clicked checkbox'
end
end
I've put a video of this below. On the first page load, the "on click" event handler fires, and button's text on the bottom right corner of the screen changes when checkboxes are selected. However, following an active search the event handler doesn't fire and the text doesn't change.
https://github.com/user-attachments/assets/9be8ebd0-5913-41c2-acc5-cfa7e2f1978c
- 主要语言
- JavaScript
- 星标
- 3.8k
- 派生
- 170
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
bigskysoftware/_hyperscript 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
bigskysoftware/_hyperscript#688 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
bigskysoftware/_hyperscript#678 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
bigskysoftware/_hyperscript#676 ·
-
难度 3/5 1-2 天 新手友好度 68/100
bigskysoftware/_hyperscript#695 ·
-
难度 3/5 1-2 天 新手友好度 62/100
bigskysoftware/_hyperscript#687 ·
查看 bigskysoftware/_hyperscript 的全部 Issue
相似的 Issue
-
bug lsp sev-3
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 90/100
Miaotofu01/Study-Mate#206 ·
维护者通常 1 天内回复
-
effort:low model:light plan planner:fable-5-1 test-quality tests
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
bug good first issue
难度 2/5 1-3 小时 新手友好度 92/100
-
难度 2/5 1-3 小时 新手友好度 63/100
zhw2590582/ArtPlayer#1073 ·