-
-
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
When state changes, nested components containing conditionals jump over other elements #569
Comments
Worth pointing out that this only occurs within the nested, truthy if-block. On the example's re-render, it self-heals to |
It's still wrong for me on every re-render - it's only on the initial render that I see the nested component rendered in the right place. No matter what I change the state to after that (toggling it between |
Hmm... I consistently see the self-healing 🤔
But yeah, without step 4, manually editing the yes/no value does not self-heal. So it seems to be narrowed to initial render + two |
Right, I believe switching templates causes it to re-instantiate the component, same as if you'd refreshed the page. It just leaves the state (the JSON at the bottom right) the same. Try updating the JSON manually between |
This feels like a similar issue to #561. If the |
The mount: function ( target, anchor ) {
insertNode( if_block_anchor, target, anchor );
if ( if_block ) { if_block.mount( target, null ); }
}, It seems like that if ( if_block ) { if_block.mount( target, if_block_anchor ); } |
Fix insertion order of if blocks and their anchors
Working as expected in 1.20.1 upwards: https://svelte.technology/repl?gist=68736c878aaf7dfee6ab503df9259f46 |
Reproduced in 1.19.1.
When a template contains an
if
, and inside of that there is a nested component that contains anotherif
, when the state changes the elements of the nested component will jump to the end of the containing element.Words are difficult - reproduction at: https://svelte.technology/repl?version=1.19.1&gist=68736c878aaf7dfee6ab503df9259f46
The text was updated successfully, but these errors were encountered: