Skip to content

Commit f2bf194

Browse files
authored
Merge pull request #16843 from IgniteUI/iminchev/fix-action-strip-elements-21.0.x
1 parent 79bbc4b commit f2bf194

3 files changed

Lines changed: 26 additions & 3 deletions

File tree

projects/igniteui-angular-elements/src/analyzer/elements.config.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,13 @@ export var registerConfig = [
4545
IgxHierarchicalGridComponent,
4646
IgxRowIslandComponent,
4747
],
48-
contentQueries: [],
48+
contentQueries: [
49+
{
50+
property: "actionButtons",
51+
childType: IgxActionStripActionsToken,
52+
isQueryList: true,
53+
},
54+
],
4955
additionalProperties: [{ name: "cdr", writable: true }],
5056
methods: ["show", "hide"],
5157
boolProps: ["hidden"],

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

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { IgxColumnComponent, IgxGridComponent, IgxHierarchicalGridComponent } from 'igniteui-angular';
1+
import { IgxActionStripComponent, IgxColumnComponent, IgxGridComponent, IgxHierarchicalGridComponent } from 'igniteui-angular';
22
import { html } from 'lit';
33
import { firstValueFrom, fromEvent, skip, timer } from 'rxjs';
44
import { ComponentRefKey, IgcNgElement } from './custom-strategy';
@@ -235,6 +235,23 @@ describe('Elements: ', () => {
235235
expect(grid.getColumnByVisibleIndex(1).field).toEqual('ProductName');
236236
});
237237

238+
it('should populate action strip actionButtons content query.', async () => {
239+
const innerHtml = `
240+
<igc-grid id="testGrid" auto-generate>
241+
<igc-action-strip id="testStrip">
242+
<igc-grid-editing-actions add-row="true"></igc-grid-editing-actions>
243+
</igc-action-strip>
244+
</igc-grid>`;
245+
testContainer.innerHTML = innerHtml;
246+
247+
// TODO: Better way to wait - potentially expose the queue or observable for update on the strategy
248+
await firstValueFrom(timer(10 /* SCHEDULE_DELAY */ * 3));
249+
250+
const actionStrip = document.querySelector<IgcNgElement>('#testStrip');
251+
const actionStripComponent = (await actionStrip.ngElementStrategy[ComponentRefKey]).instance as IgxActionStripComponent;
252+
expect(actionStripComponent.actionButtons.toArray().length).toBeGreaterThan(0);
253+
});
254+
238255
it('should not destroy action strip when row it is shown in is destroyed or cached.', async() => {
239256
const innerHtml = `
240257
<igc-grid id="testGrid" auto-generate>

projects/igniteui-angular/action-strip/src/action-strip/action-strip.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export class IgxActionStripComponent implements IgxActionStripToken, AfterViewIn
124124
* @hidden
125125
* @internal
126126
*/
127-
@ContentChildren(IgxActionStripActionsToken as any)
127+
@ContentChildren(IgxActionStripActionsToken)
128128
public actionButtons: QueryList<IgxActionStripActionsToken>;
129129

130130
/**

0 commit comments

Comments
 (0)