Skip to content

Commit

Permalink
fix: incorrect opening node for <Each/> in debug mode (closes #1168) (
Browse files Browse the repository at this point in the history
  • Loading branch information
gbj authored Jul 26, 2023
1 parent 82a2fe7 commit 7bc1ad2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion leptos_dom/src/components/each.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,9 @@ where

let component = EachRepr::default();

#[cfg(all(debug_assertions, target_arch = "wasm32", feature = "web"))]
let opening = component.opening.node.clone().unchecked_into();

#[cfg(all(target_arch = "wasm32", feature = "web"))]
let (children, closing) =
(component.children.clone(), component.closing.node.clone());
Expand All @@ -387,7 +390,11 @@ where
move |prev_hash_run: Option<HashRun<FxIndexSet<K>>>| {
let mut children_borrow = children.borrow_mut();

#[cfg(all(target_arch = "wasm32", feature = "web"))]
#[cfg(all(
not(debug_assertions),
target_arch = "wasm32",
feature = "web"
))]
let opening = if let Some(Some(child)) = children_borrow.get(0)
{
// correctly remove opening <!--<EachItem/>-->
Expand Down

0 comments on commit 7bc1ad2

Please sign in to comment.