Skip to content

Commit 564b503

Browse files
MKirovaMKirova
authored andcommitted
chore(*): Move strip handling after parentComponentRef is populated.
1 parent a307ceb commit 564b503

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

projects/igniteui-angular-elements/src/app/custom-strategy.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,6 @@ class IgxCustomNgElementStrategy extends ComponentNgElementStrategy {
115115
if (parent?.ngElementStrategy) {
116116
this.angularParent = parent.ngElementStrategy.angularParent;
117117

118-
// action strip is reused in row island child grid
119-
// assign parent so it's not destroyed on detach/attach.
120-
if (element.tagName.toLocaleLowerCase() === 'igc-action-strip') {
121-
this.angularParent = (parent.ngElementStrategy as any).componentRef;
122-
}
123-
124118
this.parentElement = new WeakRef(parent);
125119
let parentComponentRef = await parent?.ngElementStrategy[ComponentRefKey];
126120
parentInjector = parentComponentRef?.injector;
@@ -133,6 +127,12 @@ class IgxCustomNgElementStrategy extends ComponentNgElementStrategy {
133127
parentComponentRef = await parent?.ngElementStrategy[ComponentRefKey];
134128
parentAnchor = parentComponentRef?.instance.anchor;
135129
}
130+
131+
// action strip is reused for all rows
132+
// assign parent so it's not destroyed on detach/attach.
133+
if (element.tagName.toLocaleLowerCase() === 'igc-action-strip' || configParent.selector === 'igc-action-strip') {
134+
this.angularParent = parentComponentRef;
135+
}
136136
} else if ((parent as any)?.__componentRef) {
137137
this.angularParent = (parent as any).__componentRef;
138138
parentInjector = this.angularParent.injector;

0 commit comments

Comments
 (0)