mirror of
https://github.com/DioxusLabs/dioxus
synced 2025-02-17 06:08:26 +00:00
fix double drop of bubble id
This commit is contained in:
parent
9552ab6c1c
commit
02456c1068
3 changed files with 10 additions and 3 deletions
|
@ -162,7 +162,9 @@ impl VirtualDom {
|
|||
let element_refs_slab = &mut self.element_refs;
|
||||
for element_ref in element_refs.drain(..) {
|
||||
println!("Dropping element ref {:?}", element_ref);
|
||||
element_refs_slab[element_ref.0].template = None;
|
||||
if let Some(element_ref) = element_refs_slab.get_mut(element_ref.0) {
|
||||
element_ref.template = None;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -371,7 +371,8 @@ impl VirtualDom {
|
|||
// Loop through each dynamic attribute (in a depth first order) in this template before moving up to the template's parent.
|
||||
while let Some(el_ref) = parent_path {
|
||||
// safety: we maintain references of all vnodes in the element slab
|
||||
let template = unsafe { &*el_ref.template.unwrap() };
|
||||
let template =
|
||||
unsafe { &*el_ref.template.expect("template reference should be valid") };
|
||||
let node_template = template.template.get();
|
||||
let target_path = el_ref.path;
|
||||
|
||||
|
|
|
@ -42,7 +42,11 @@ fn app(cx: Scope) -> Element {
|
|||
*CLICKS.lock().unwrap() += 1;
|
||||
},
|
||||
|
||||
problematic_child {}
|
||||
vec![
|
||||
render! {
|
||||
problematic_child {}
|
||||
}
|
||||
].into_iter()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue