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

Some combination of keyed blocks and binding breaks array looping #721

Closed
TehShrike opened this issue Jul 25, 2017 · 4 comments
Closed

Some combination of keyed blocks and binding breaks array looping #721

TehShrike opened this issue Jul 25, 2017 · 4 comments
Labels

Comments

@TehShrike
Copy link
Member

TehShrike commented Jul 25, 2017

Reproduction: https://svelte.technology/repl?version=1.26.0&gist=59c36b2a892a2e3be0d6b1441f5971f5

When the number is increased, on every other change, only the first two (after the reverse) elements are displayed.

Like the note in the repl says, if you remove any one of bind:top="idToTop[object.id]", position="{{object.id}}", or .reverse(), the issue doesn't happen.

@TehShrike
Copy link
Member Author

Beyond that, here's the case I was actually trying to work towards, where the index/position in the array is passed in to the child component: https://svelte.technology/repl?version=1.26.0&gist=8e6a7f22a5813d146e2fa04d21285fd6

With the added this.observe('position') in the child, It produces actual console errors :-D

@TehShrike
Copy link
Member Author

It looks like #728 only addresses the issue in that original repl link - should I just plan on this issue being closed and opening a new issue if the second repl still has issues after that patch is released?

@Rich-Harris
Copy link
Member

@TehShrike will look into the second one separately. If we can fix both in one release, probably no need to raise a second issue

@Rich-Harris
Copy link
Member

On second thoughts, this might warrant a separate issue. I've been poking around for a while and it's... complicated. Not currently sure what the best solution is. Have opened #730.

Rich-Harris added a commit that referenced this issue Jul 29, 2017
use _set, not set, when updating child components
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants