Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Appending to a table removes the events of its childrens #555

Open
ignamartinoli opened this issue Jul 25, 2024 · 0 comments
Open

Appending to a table removes the events of its childrens #555

ignamartinoli opened this issue Jul 25, 2024 · 0 comments

Comments

@ignamartinoli
Copy link

ignamartinoli commented Jul 25, 2024

With this dynamic table example:

<table>
	<thead>
		<tr>
			<th>Column 1</th>
			<th>Column 2</th>
			<th>Actions</th>
		</tr>
	</thead>
	<tbody id="table">
		<tr>
			<td><input type="text" /></td>
			<td><input type="text" /></td>
			<td><button _="on click remove closest <tr />">Remove</button></td>
		</tr>
	</tbody>
</table>
<button _="on click append `
	<tr>
		<td><input type='text' /></td>
		<td><input type='text' /></td>
		<td><button _='on click remove closest <tr />'>Remove</button></td>
	</tr>
` to #table">Add row</button>

The on click remove closest <tr /> handler works, until a row is added. Then only the append command will work, but disabling the remove command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant