mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-27 06:30:20 +00:00
fix: dont clone callbacks
This commit is contained in:
parent
c409fecaaf
commit
3faef30075
1 changed files with 20 additions and 7 deletions
|
@ -209,6 +209,17 @@ impl<'b> VirtualDom {
|
|||
// AttributeValue::None => todo!(),
|
||||
// }
|
||||
|
||||
// Safety: we promise not to re-alias this text later on after committing it to the mutation
|
||||
|
||||
match &attribute.value {
|
||||
AttributeValue::Listener(_) => {
|
||||
self.mutations.push(NewEventListener {
|
||||
// all listeners start with "on"
|
||||
name: &unbounded_name[2..],
|
||||
id,
|
||||
})
|
||||
}
|
||||
_ => {
|
||||
// Safety: we promise not to re-alias this text later on after committing it to the mutation
|
||||
let unbounded_value = unsafe { std::mem::transmute(attribute.value.clone()) };
|
||||
|
||||
|
@ -217,7 +228,9 @@ impl<'b> VirtualDom {
|
|||
value: unbounded_value,
|
||||
ns: attribute.namespace,
|
||||
id,
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn load_template_root(&mut self, template: &VNode, root_idx: usize) -> ElementId {
|
||||
|
|
Loading…
Reference in a new issue