diff --git a/TODO.md b/TODO.md index ee2e98739..b4fe2e4e3 100644 --- a/TODO.md +++ b/TODO.md @@ -1,7 +1,5 @@ - [ ] Async - [x] Resource - - [ ] Render bug: when doing e.g., a `match` and having multiple branches with separate `template`s, all exist as separate document fragment and replace the fragment, not one another -- find a way to make sure that `Child<'a>` returned from `insert` is _actually_ attached to the DOM - - [ ] Render bug with list reconciliation - [ ] Suspense - [ ] Docs (and clippy warning to insist on docs) - [ ] Read through + understand... diff --git a/leptos_dom/src/render.rs b/leptos_dom/src/render.rs index c353d592e..6727d86d0 100644 --- a/leptos_dom/src/render.rs +++ b/leptos_dom/src/render.rs @@ -98,15 +98,12 @@ pub fn insert<'a>( value = f(); } - insert_expression( + current = Some(insert_expression( parent.clone().unchecked_into(), &f(), current.clone().unwrap_or(Child::Null), - //current.get_untracked().clone(), // get untracked to avoid infinite loop when we set current, below before.as_ref(), - ); - - current = Some(value); + )); }); } _ => { @@ -132,6 +129,12 @@ pub fn insert_expression<'a>( parent.node_name(), current ); + if let Child::Node(node) = ¤t { + crate::log!( + "current's parent = {}", + node.parent_node().unwrap().node_name() + ); + } if new_value == ¤t { current