Skip to content
Open
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export abstract class IgxActionStripToken {
public abstract cdr: ChangeDetectorRef
public abstract context: any;
public abstract menuOverlaySettings: OverlaySettings;
public abstract get menuItems(): any[];
public abstract get hideOnRowLeave(): boolean;

public abstract show(context?: any): void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,26 @@ describe('igxGridPinningActions #grid ', () => {
const secondToLastVisible = grid.rowList.toArray()[grid.rowList.length - 2];
expect(secondToLastVisible.key).toEqual('FAMIA');
});

it('should not hide action strip in base mode when scrollToRow is invoked', () => {
grid.pinRow('FAMIA');
fixture.detectChanges();

const pinnedRow = grid.pinnedRows[0];
actionStrip.show(pinnedRow);
fixture.detectChanges();

const pinningActions = fixture.debugElement.query(By.directive(IgxGridPinningActionsComponent))
.componentInstance as IgxGridPinningActionsComponent;
spyOn<any>(grid, 'scrollTo');

pinningActions.scrollToRow(null);
fixture.detectChanges();

expect((grid as any).scrollTo).toHaveBeenCalledWith(pinnedRow.data, 0);
expect(actionStrip.hidden).toBeFalse();
expect(actionStrip.context).toBe(pinnedRow);
});
});

describe('Menu ', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@ export class IgxGridPinningActionsComponent extends IgxGridActionsBaseDirective
const context = this.strip.context;
const grid = context.grid;
grid.scrollTo(context.data, 0);
this.strip.hide();

if (this.asMenuItems) {
this.strip.hide();
}
}

private registerSVGIcons(): void {
Expand Down
15 changes: 12 additions & 3 deletions projects/igniteui-angular/grids/grid/src/grid-base.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7793,9 +7793,18 @@ export abstract class IgxGridBaseDirective implements GridType,
this.disableTransitions = false;

this.hideOverlays();
this.actionStrip?.hide();
if (this.actionStrip) {
this.actionStrip.context = null;
const context = this.actionStrip?.context;
const contextEl = context?.element?.nativeElement as HTMLElement;
const keepActionStrip =
!!context?.pinned &&
!!contextEl?.isConnected &&
!(this.actionStrip?.menuItems?.length > 0);

if (!keepActionStrip) {
if (this.actionStrip) {
this.actionStrip.hide();
this.actionStrip.context = null;
}
}
const args: IGridScrollEventArgs = {
direction: 'vertical',
Expand Down
Loading