Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

bind:this={array[index]} breaks inside snippet #16421

Open
@hyunbinseo

Description

@hyunbinseo

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

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


      [8]ページ先頭

      ©2009-2025 Movatter.jp