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

Tricky component binding blowback case #730

Closed
Rich-Harris opened this issue Jul 29, 2017 · 2 comments
Closed

Tricky component binding blowback case #730

Rich-Harris opened this issue Jul 29, 2017 · 2 comments
Labels

Comments

@Rich-Harris
Copy link
Member

Rich-Harris commented Jul 29, 2017

Via #721REPL. (An aside — there's a weird 'Cannot set read-only property' error happening in the REPL... currently only reproducible if you download it. Weird.)

The observer created in the Top.html component's oncreate hook causes everything to be updated while an update is already in progress, which is a problem. Not sure quite why it's resulting in that behaviour (list items being dropped) though.

I daresay this is one of the cases where two-way binding is dangerous. Svelte should still be able to handle it though.

@TehShrike one workaround is to change this...

this.observe('position', () => this.updateTop())

...to this:

this.observe('position', () => {
  Promise.resolve().then(() => this.updateTop());
});
@TehShrike
Copy link
Member

Ah, trippy - that might actually cause some flickering in my use case, but I'll roll with that workaround once #728 goes out and see how it goes.

@Rich-Harris
Copy link
Member Author

I think we're probably safe to close this given how differently v3 handles this stuff

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