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

wrong result when an existing list is updated #62

Closed
seriousManual opened this issue Nov 30, 2016 · 2 comments · Fixed by #72
Closed

wrong result when an existing list is updated #62

seriousManual opened this issue Nov 30, 2016 · 2 comments · Fixed by #72
Labels

Comments

@seriousManual
Copy link

seriousManual commented Nov 30, 2016

svelte-cli version 1.0.2

consider the following template:

{{#each samples as sample}}
    {{sample}}<br>
{{/each}}

compiled via the svelte-cli and invoked with the following code

<!doctype html>
<html>
<head>
    <title>My first Svelte app</title>
</head>
<body>
<main></main>
<script src='helloWorld.js'></script>
<script>
    var app = new helloWorld({
        target: document.querySelector( 'main' ),
        data: {
            samples: ['foo', 'bar', 'bax', 'baz']
        }
    });

    app.set({samples: ['foo', 'baz']});
</script>
</body>
</html>

expected result:

foo
baz

actual result:

foo
baz
baxbaz
Rich-Harris added a commit that referenced this issue Nov 30, 2016
remove text nodes when removing iterations of each block
@Rich-Harris
Copy link
Member

Thanks – fixed in 1.0.4

@seriousManual
Copy link
Author

lgtm!

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