Commit 372a443
committed
fix: stop unlinking parents on array-valued bindings
setPropertyInternal cleared `parent` and `parentNode` on every array it
assigned, working around `_addView` throwing "View already has a parent" when a
shared SegmentedBarItem[] was re-bound to a freshly created host inside a
ListView item template (NativeScript/nativescript-angular#900).
The workaround was both too broad and unsound. It ran for every array-valued
binding, so plain data models carrying `parent`/`parentNode` fields were
silently mutated, and it threw a TypeError on null or undefined array entries.
It also assigned `parent` directly instead of going through `_removeView`, so
`_tearDownUI` and `_parentChanged` never ran and `_context` stayed set --
making the new host's `_setupUI` take its `this._context === context` early
return and leaving the re-parented view out of the native visual tree entirely.
The detach belongs in core, where SegmentedBarBase.onItemsChanged and
TabViewBase.onItemsChanged can un-parent through `_removeView` before adopting.
This requires that core-side fix to be present.1 parent 6daed00 commit 372a443
1 file changed
Lines changed: 0 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
490 | 490 | | |
491 | 491 | | |
492 | 492 | | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | 493 | | |
499 | 494 | | |
500 | 495 | | |
| |||
505 | 500 | | |
506 | 501 | | |
507 | 502 | | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | | - | |
520 | 503 | | |
521 | 504 | | |
522 | 505 | | |
| |||
0 commit comments