-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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 does not render the {:else} clause #4536
Comments
Hi! It seems the bug was introduced in #4413. |
Good find! Make a simpler failing test case, e.g. REPL (working in 3.18.2). See the runtime each-block-else test case. Probably the best is to make a keyed version for each-block-else, so |
Thank you! I'll try in a few hours. |
The test case above is just a copy of the |
This has been fixed in 3.20.0 - https://svelte.dev/repl/adc8c6b13f9b44aeaf80165bb786392a?version=3.20.0 |
Description:
A keyed each block does not render its
{:else}
clause when there is 0 items in the store:-it does render the clause after startup (on mount = render = or whatever I should call it)
-it does NOT render it when the items are removed during the existence of the component
REPL:
https://svelte.dev/repl/adc8c6b13f9b44aeaf80165bb786392a?version=3.19.2
You can see there is a store with a few items that are then just written out in an each block. Then there is a button which updates the store by setting an empty array to it.
Steps to reproduce:
Result:
The {:else} clause not rendered.
Expected result:
The {:else} clause rendered.
Additional information:
Am I missing something here? Why would the each block's key block the output of the else clause? This must be a bug...
The text was updated successfully, but these errors were encountered: