Merge pull request #1765 from traxys/fixup_wasm_replace
winit: Fix replacement of node in wasm
This commit is contained in:
commit
be36c3f552
1 changed files with 11 additions and 7 deletions
|
|
@ -179,13 +179,17 @@ where
|
|||
.unwrap_or(None)
|
||||
});
|
||||
|
||||
let _ = match target {
|
||||
Some(node) => node
|
||||
.replace_child(&canvas, &node)
|
||||
.expect(&format!("Could not replace #{}", node.id())),
|
||||
None => body
|
||||
.append_child(&canvas)
|
||||
.expect("Append canvas to HTML body"),
|
||||
match target {
|
||||
Some(node) => {
|
||||
let _ = node
|
||||
.replace_with_with_node_1(&canvas)
|
||||
.expect(&format!("Could not replace #{}", node.id()));
|
||||
}
|
||||
None => {
|
||||
let _ = body
|
||||
.append_child(&canvas)
|
||||
.expect("Append canvas to HTML body");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue