fix: incorrect opening node for <Each/> in debug mode (closes #1168) (#1436)

This commit is contained in:
Greg Johnston 2023-07-26 10:43:46 -04:00 committed by GitHub
parent 82a2fe7cbe
commit 7bc1ad2b4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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());
@ -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/>-->