-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Description
Describe the bug
Reference #16414
The 1st onclick callback should be defined once and be reused, but is no longer the case
{#each { length: 2 }, index}
<button type="button" value={index} onclick={(e) => console.log(e.currentTarget.value)}>
{index}
</button>
<button type="button" onclick={() => console.log(index)}>{index}</button>
{/each}// was
var on_click = (e) => console.log(e.currentTarget.value);
button.__click = [on_click];
// as-is
$.each(node, 0, () => ({ length: 2 }), $.index, ($$anchor, $$item, index) => {
var fragment_1 = root_1();
var button = $.first_child(fragment_1);
$.set_value(button, index);
button.__click = (e) => console.log(e.currentTarget.value);Reproduction
From the issue body
From #16414
Severity
blocking an upgrade
Metadata
Metadata
Assignees
Labels
No labels