Skip to content

Commit ee086c0

Browse files
committed
chor: skip detached elements for removeFromVisualTree
1 parent 4e32e89 commit ee086c0

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

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

+3-6
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,9 @@ export class ViewUtil {
182182
}
183183

184184
this.removeFromQueue(extendedParent, extendedChild);
185-
this.removeFromVisualTree(extendedParent, extendedChild);
185+
if (!isDetachedElement(extendedChild)) {
186+
this.removeFromVisualTree(extendedParent, extendedChild);
187+
}
186188
}
187189

188190
private removeFromQueue(parent: NgView, child: NgView) {
@@ -264,11 +266,6 @@ export class ViewUtil {
264266
this.removeLayoutChild(parent, child);
265267
} else if (isContentView(parent) && parent.content === child) {
266268
parent.content = null;
267-
} else if (child.nodeName === "DetachedContainer") {
268-
// Skip - DetachedContainer is... well detached from its parent
269-
// Used with ListViews and other TemplatedItemsComponent views.
270-
} else if (child.nodeName === "FormattedString" || child.nodeName === "Span") {
271-
// Removing FormattedString and its Spans from a Label throws an exception
272269
} else if (isView(parent)) {
273270
parent._removeView(child);
274271
}

0 commit comments

Comments
 (0)