-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Closed
Description
Describe the bug
The content of {:else} in an {#each} block where I iterate over Object.keys(data) is shown in some cases, but not in others.
I would expect:
- do not update the content of {#each} when iterating over something like Object.keys(data) as it is not a $state / $derived
- OR update the content (like it does now), but also show and hide the content of {:else}
To reproduce:
- open REPL
- click button to change second {#each} block
I have a local setup (that I cannot reproduce that quickly in a REPL) where I have a third constellation:
filter data -> no result -> only {:else} content shown -> remove filter -> data AND {:else} content visible
Workaround
{#each Object.keys(data) as key}
// use key
{/each}
{#if Object.keys(data).length === 0}
// use instead of {:each}
{/if)
Reproduction
Logs
No response
System Info
REPL
Severity
annoyance
Metadata
Metadata
Assignees
Labels
No labels