Skip to content

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

Closed
@ignamartinoli

Description

@ignamartinoli

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions