Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Hyperscript behavior ceases to work after active search

Open
#638 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript
Domain
frontend, web-dev

Research direction

Start with the form's _="install CheckBoxDataGrid" behavior and the <tbody> replacement described in the issue, then reproduce the active-search swap. Verify that the checkbox click handler still fires and logs clicked checkbox after the replacement; the issue is resolved when the behavior continues working on the new rows.

Written by the indexing model from the issue text.

Description

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

Dominant language
JavaScript
Stars
3.8k
Forks
171
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bigskysoftware/_hyperscript

All issues in bigskysoftware/_hyperscript

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.