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

Store binding inside each is broken #3455

Closed
Rich-Harris opened this issue Aug 23, 2019 · 2 comments · Fixed by #3534
Closed

Store binding inside each is broken #3455

Rich-Harris opened this issue Aug 23, 2019 · 2 comments · Fixed by #3534
Labels

Comments

@Rich-Harris
Copy link
Member

Describe the bug

This doesn't work:

{#each $items as item, index}
  <input bind:value={item.text}>
{/each}

To Reproduce

https://svelte.dev/repl/358a3620fd6b4f159a90268a6b2035a4?version=3.9.1

Expected behavior

Editing the text input should update the store

Severity

Seems bad

Additional context

https://stackoverflow.com/questions/57626273/svelte-component-not-re-rendering-with-new-values-if-text-input-is-inside-an-eac

@ghost
Copy link

ghost commented Aug 23, 2019

As a workaround, this works:

<input bind:value={$items[index].text}>

Might help track down how to correct it.

Rich-Harris added a commit that referenced this issue Sep 8, 2019
Fix store bindings in each blocks
@tettusud

This comment has been minimized.

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

Successfully merging a pull request may close this issue.

2 participants