Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@ export var registerConfig = [
IgxHierarchicalGridComponent,
IgxRowIslandComponent,
],
contentQueries: [],
contentQueries: [
{
property: "actionButtons",
childType: IgxActionStripActionsToken,
isQueryList: true,
},
],
additionalProperties: [{ name: "cdr", writable: true }],
methods: ["show", "hide"],
boolProps: ["hidden"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IgxColumnComponent, IgxGridComponent, IgxHierarchicalGridComponent } from 'igniteui-angular';
import { IgxActionStripComponent, IgxColumnComponent, IgxGridComponent, IgxHierarchicalGridComponent } from 'igniteui-angular';
import { html } from 'lit';
import { firstValueFrom, fromEvent, skip, timer } from 'rxjs';
import { ComponentRefKey, IgcNgElement } from './custom-strategy';
Expand Down Expand Up @@ -235,6 +235,23 @@ describe('Elements: ', () => {
expect(grid.getColumnByVisibleIndex(1).field).toEqual('ProductName');
});

it('should populate action strip actionButtons content query.', async () => {
const innerHtml = `
<igc-grid id="testGrid" auto-generate>
<igc-action-strip id="testStrip">
<igc-grid-editing-actions add-row="true"></igc-grid-editing-actions>
</igc-action-strip>
</igc-grid>`;
testContainer.innerHTML = innerHtml;

// TODO: Better way to wait - potentially expose the queue or observable for update on the strategy
await firstValueFrom(timer(10 /* SCHEDULE_DELAY */ * 3));

const actionStrip = document.querySelector<IgcNgElement>('#testStrip');
const actionStripComponent = (await actionStrip.ngElementStrategy[ComponentRefKey]).instance as IgxActionStripComponent;
expect(actionStripComponent.actionButtons.toArray().length).toBeGreaterThan(0);
});

it('should not destroy action strip when row it is shown in is destroyed or cached.', async() => {
const innerHtml = `
<igc-grid id="testGrid" auto-generate>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export class IgxActionStripComponent implements IgxActionStripToken, AfterViewIn
* @hidden
* @internal
*/
@ContentChildren(IgxActionStripActionsToken as any)
@ContentChildren(IgxActionStripActionsToken)
public actionButtons: QueryList<IgxActionStripActionsToken>;

/**
Expand Down
Loading