Skip to content

Commit 5735a01

Browse files
authored
fix(renderer): dynamic views can't be prepended (#2262)
1 parent a868c3a commit 5735a01

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: nativescript-angular/view-util.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ export class ViewUtil {
4141
const extendedParent = this.ensureNgViewExtensions(parent);
4242
const extendedChild = this.ensureNgViewExtensions(child);
4343

44-
if (!previous) {
44+
// the element should be between previous and next
45+
// if there's next but no previous, it's the first element
46+
// if there's previous but no next, it's the last element
47+
// elements that have no previous/next elements must be appended
48+
if (!previous && !next) {
4549
previous = extendedParent.lastChild;
4650
}
4751
this.addToQueue(extendedParent, extendedChild, previous, next);

0 commit comments

Comments
 (0)