We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a40faf4 commit 1639635Copy full SHA for 1639635
yew/src/virtual_dom/vlist.rs
@@ -1,5 +1,5 @@
1
//! This module contains fragments implementation.
2
-use super::{Key, VDiff, VNode, VText};
+use super::{Key, VDiff, VNode, VTag};
3
use crate::html::{AnyScope, NodeRef};
4
use cfg_if::cfg_if;
5
use std::collections::HashMap;
@@ -302,8 +302,10 @@ impl VDiff for VList {
302
if self.children.is_empty() {
303
// Without a placeholder the next element becomes first
304
// and corrupts the order of rendering
305
- // We use empty text element to stake out a place
306
- self.add_child(VText::new("").into());
+ // We use empty span element to stake out a place
+ let mut placeholder = VTag::new("span");
307
+ placeholder.key = Some("__placeholder".into());
308
+ self.children = vec![placeholder.into()];
309
}
310
311
let lefts = &mut self.children;
0 commit comments