Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Hyperscript behavior ceases to work after active search

未关闭
#638 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

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

调研方向

先从表单的 _="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,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

bigskysoftware/_hyperscript 的其他 Issue

查看 bigskysoftware/_hyperscript 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

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