fix: dont clone callbacks
This commit is contained in:
1 parent
c409fecaaf
commit
3faef30075
1 file changed
+20
-7
@@ -210,14 +210,27 @@ impl<'b> VirtualDom {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
// Safety: we promise not to re-alias this text later on after committing it to the mutation
|
// 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()) };
|
|
||||||
|
|
||||||
self.mutations.push(SetAttribute {
|
match &attribute.value {
|
||||||
name: unbounded_name,
|
AttributeValue::Listener(_) => {
|
||||||
value: unbounded_value,
|
self.mutations.push(NewEventListener {
|
||||||
ns: attribute.namespace,
|
// all listeners start with "on"
|
||||||
id,
|
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()) };
|
||||||
|
|
||||||
|
self.mutations.push(SetAttribute {
|
||||||
|
name: unbounded_name,
|
||||||
|
value: unbounded_value,
|
||||||
|
ns: attribute.namespace,
|
||||||
|
id,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn load_template_root(&mut self, template: &VNode, root_idx: usize) -> ElementId {
|
fn load_template_root(&mut self, template: &VNode, root_idx: usize) -> ElementId {
|
||||||
|
|||||||
Reference in new issue
Block a user