File tree 1 file changed +7
-1
lines changed 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -114,11 +114,17 @@ export class NativeScriptRenderer extends Renderer {
114
114
115
115
attachViewAfter ( anchorNode : NgView , viewRootNodes : NgView [ ] ) {
116
116
traceLog ( 'NativeScriptRenderer.attachViewAfter: ' + anchorNode . nodeName + ' ' + anchorNode ) ;
117
- const parent = ( < NgView > anchorNode . parent || anchorNode . templateParent ) ;
117
+ //HACK: The anchor.templateParent precedence and child.templateParent
118
+ //assignment are a workaround for RadSideDrawer.
119
+ //Remove it once we ship the fix in the RadSideDrawer directives.
120
+ const parent = ( anchorNode . templateParent || < NgView > anchorNode . parent ) ;
118
121
const insertPosition = this . viewUtil . getChildIndex ( parent , anchorNode ) ;
119
122
120
123
viewRootNodes . forEach ( ( node , index ) => {
121
124
const childIndex = insertPosition + index + 1 ;
125
+ //Remember the template parent in case someone moves the view element
126
+ //before Angular attaches the next view.
127
+ node . templateParent = parent ;
122
128
this . viewUtil . insertChild ( parent , node , childIndex ) ;
123
129
this . animateNodeEnter ( node ) ;
124
130
} ) ;
You can’t perform that action at this time.
0 commit comments