File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 1
1
//! This module contains fragments implementation.
2
- use super :: { Key , VDiff , VNode , VText } ;
2
+ use super :: { Key , VDiff , VNode , VTag } ;
3
3
use crate :: html:: { AnyScope , NodeRef } ;
4
4
use cfg_if:: cfg_if;
5
5
use std:: collections:: HashMap ;
@@ -302,8 +302,10 @@ impl VDiff for VList {
302
302
if self . children . is_empty ( ) {
303
303
// Without a placeholder the next element becomes first
304
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 ( ) ) ;
305
+ // We use empty span element to stake out a place
306
+ let mut placeholder = VTag :: new ( "span" ) ;
307
+ placeholder. key = Some ( "__placeholder" . into ( ) ) ;
308
+ self . children = vec ! [ placeholder. into( ) ] ;
307
309
}
308
310
309
311
let lefts = & mut self . children ;
You can’t perform that action at this time.
0 commit comments