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 11//! This module contains fragments implementation.
2- use super :: { Key , VDiff , VNode , VText } ;
2+ use super :: { Key , VDiff , VNode , VTag } ;
33use crate :: html:: { AnyScope , NodeRef } ;
44use cfg_if:: cfg_if;
55use std:: collections:: HashMap ;
@@ -302,8 +302,10 @@ impl VDiff for VList {
302302 if self . children . is_empty ( ) {
303303 // Without a placeholder the next element becomes first
304304 // 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( ) ] ;
307309 }
308310
309311 let lefts = & mut self . children ;
You can’t perform that action at this time.
0 commit comments