File tree 1 file changed +12
-7
lines changed
1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -122,19 +122,24 @@ export class ViewUtil {
122
122
this . removeLayoutChild ( parent , child ) ;
123
123
}
124
124
125
- // Find next actual element
126
- while ( next && isDetachedElement ( next ) ) {
127
- next = next . nextSibling ;
128
- }
129
-
130
- if ( next ) {
131
- const index = parent . getChildIndex ( next ) ;
125
+ const nextVisual = this . findNextVisual ( next ) ;
126
+ if ( nextVisual ) {
127
+ const index = parent . getChildIndex ( nextVisual ) ;
132
128
parent . insertChild ( child , index ) ;
133
129
} else {
134
130
parent . addChild ( child ) ;
135
131
}
136
132
}
137
133
134
+ private findNextVisual ( view : NgView ) {
135
+ let next = view ;
136
+ while ( next && isDetachedElement ( next ) ) {
137
+ next = next . nextSibling ;
138
+ }
139
+
140
+ return next ;
141
+ }
142
+
138
143
public removeChild ( parent : NgView , child : NgView ) {
139
144
if ( ! parent ) {
140
145
return ;
You can’t perform that action at this time.
0 commit comments