Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork4.6k
Open
Description
Describe the bug
This breaks if the<button>
is converted into a#snippet
and@render
.
If two buttons are added (total of 3), and the middle one is deleted:
Expectation (without snippet)buttons: [ button#1752753750393, button#1752753998281, null ]Reality (with snippet, even after awaiting tick)buttons: [ button#1752753750393, null, button#1752753998281 ]
<!-- without snippet --><scriptlang="ts">import {SvelteSet }from'svelte/reactivity';let ids=newSvelteSet([Date.now().toString()]);let buttons:HTMLButtonElement[]=$state([]);</script>{#eachidsasid,index (id)} <button {id}bind:this={buttons[index]}type="button"onclick={(e)=>ids.delete(e.currentTarget.id)} > {id} </button>{/each}<buttontype="button"onclick={()=>ids.add(Date.now().toString())}>Add</button>
Reproduction
https://svelte.dev/playground/83179835f11d4e4ca75d5a31e743d75b?version=5.36.6
Logs
System Info
-
Severity
annoyance
Metadata
Metadata
Assignees
Labels
No labels