-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Keyed {#each} block's {:else} statement is rendering when it shouldn't #4549
Comments
This can probably be combined with #4536. |
Agreed - after noticing that one, I played with it more and found that whether it renders the :else depends entirely on whether the array was populated initially or not. It will always render if array had no value to start, and will never render if array had a value to start. Better REPL: |
This is fixed in 3.20.0 - https://svelte.dev/repl/fa1e979afd1a4928ac45e84fe48574c1?version=3.20.0 |
Describe the bug
Keyed {#each} block's {:else} statement is rendering when it shouldn't (if the array was empty initially).
Keyed {#each} block's {:else} statement is not rendering when it should (if the array had values initially).
To Reproduce
Click the first toggle - placeholder always shows.
Click the second toggle - placeholder never shows.
If you remove the key on each, behaves as expected, but not a solution.
https://svelte.dev/repl/fa1e979afd1a4928ac45e84fe48574c1?version=3.19.2
Information about your Svelte project:
Chrome 80
Windows 10
Svelte 3.19.2
Webpack, but REPL does it too
Severity
Minor - can just use separate {#if} outside the {#each}
The text was updated successfully, but these errors were encountered: