You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OK so this code in Svelte REPL and Malina REPL does different things:
<script>letoutput=""functionaction(el){output=el.innerText}</script><divuse:action>
{#each [1,2,3,4] as i}
{i}
{/each}
</div>
DIV CONTAINS: {output}
Malina runs it before children update so it gets "". Svelte runs it after children update so it gets "1 2 3 4".
I don't mind whichever one is the default, but I don't know how to get Svelte-like behavior in Malina, and I need it.
Svelte even has await tick() I could use for this if it wasn't already default to wait for full render, but I don't think Malina has anything like that.
(for my use case I need parent's scrollHeight etc. to see which elements can be seen and do some conditional rendering logic, and that won't be ready until all children are rendered).
The text was updated successfully, but these errors were encountered:
Svelte even has await tick() I could use for this if it wasn't already default to wait for full render, but I don't think Malina has anything like that.
You can use await $tick() (no need to import in component or import it from malinajs/runtime.js when use it in external function.
Just tried another thing. onMount behaves like use: + await tick(). It waits for render of component's own stuff, but it does not wait for its children to render.
OK so this code in Svelte REPL and Malina REPL does different things:
Malina runs it before children update so it gets "". Svelte runs it after children update so it gets "1 2 3 4".
I don't mind whichever one is the default, but I don't know how to get Svelte-like behavior in Malina, and I need it.
Svelte even has
await tick()
I could use for this if it wasn't already default to wait for full render, but I don't think Malina has anything like that.(for my use case I need parent's
scrollHeight
etc. to see which elements can be seen and do some conditional rendering logic, and that won't be ready until all children are rendered).The text was updated successfully, but these errors were encountered: