summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2023-03-23 11:31:59 +0100
committerLibravatar GitHub <noreply@github.com>2023-03-23 11:31:59 +0100
commitbe36c3f552699d74665da2880534248d217ac80e (patch)
treefbb5582d498dbaaa142a74080cc02e91e5760847
parentd7fffaa801423ae989fa7693f5b1cb424194e1ff (diff)
parent0231ed6f1d5929d84bb81e6673d3319a24f08b16 (diff)
downloadiced-be36c3f552699d74665da2880534248d217ac80e.tar.gz
iced-be36c3f552699d74665da2880534248d217ac80e.tar.bz2
iced-be36c3f552699d74665da2880534248d217ac80e.zip
Merge pull request #1765 from traxys/fixup_wasm_replace
winit: Fix replacement of node in wasm
-rw-r--r--winit/src/application.rs18
1 files changed, 11 insertions, 7 deletions
diff --git a/winit/src/application.rs b/winit/src/application.rs
index b13b7214..31654f26 100644
--- a/winit/src/application.rs
+++ b/winit/src/application.rs
@@ -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");
+ }
};
}