Skip to content

Commit 88d839c

Browse files
committed
fix(grid): update action strip visibility logic for pinned rows
1 parent b57fcd0 commit 88d839c

File tree

2 files changed

+2
-47
lines changed

2 files changed

+2
-47
lines changed

projects/igniteui-angular/src/lib/action-strip/grid-actions/grid-pinning-actions.component.spec.ts

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -72,32 +72,6 @@ describe('igxGridPinningActions #grid ', () => {
7272
expect(secondToLastVisible.key).toEqual('FAMIA');
7373
});
7474

75-
it('should keep action strip visible and preserve context when jumping from hovered pinned row', async () => {
76-
grid.pinRow('FAMIA');
77-
fixture.detectChanges();
78-
79-
const pinnedRow = grid.pinnedRows[0];
80-
actionStrip.show(pinnedRow);
81-
fixture.detectChanges();
82-
83-
const initialContext = actionStrip.context;
84-
const contextElement = initialContext.element.nativeElement as HTMLElement;
85-
spyOn(contextElement, 'matches').and.callFake((selector: string) =>
86-
selector === ':hover' ? true : HTMLElement.prototype.matches.call(contextElement, selector)
87-
);
88-
89-
const pinningButtons = fixture.debugElement.queryAll(By.css(`igx-grid-pinning-actions button`));
90-
const jumpButton = pinningButtons[0];
91-
jumpButton.triggerEventHandler('click', new Event('click'));
92-
await wait();
93-
fixture.detectChanges();
94-
await wait(60);
95-
fixture.detectChanges();
96-
97-
expect(actionStrip.hidden).toBeFalse();
98-
expect(actionStrip.context).toBe(initialContext);
99-
});
100-
10175
it('should not hide action strip in base mode when scrollToRow is invoked', () => {
10276
grid.pinRow('FAMIA');
10377
fixture.detectChanges();
@@ -140,25 +114,6 @@ describe('igxGridPinningActions #grid ', () => {
140114
fixture.detectChanges();
141115
expect(grid.pinnedRows.length).toBe(1);
142116
});
143-
144-
it('should hide action strip in menu mode when scrollToRow is invoked', () => {
145-
grid.pinRow('FAMIA');
146-
fixture.detectChanges();
147-
148-
const pinnedRow = grid.pinnedRows[0];
149-
actionStrip.show(pinnedRow);
150-
fixture.detectChanges();
151-
152-
const pinningActions = fixture.debugElement.query(By.directive(IgxGridPinningActionsComponent))
153-
.componentInstance as IgxGridPinningActionsComponent;
154-
spyOn<any>(grid, 'scrollTo');
155-
156-
pinningActions.scrollToRow(null);
157-
fixture.detectChanges();
158-
159-
expect((grid as any).scrollTo).toHaveBeenCalledWith(pinnedRow.data, 0);
160-
expect(actionStrip.hidden).toBeTrue();
161-
});
162117
});
163118
});
164119

projects/igniteui-angular/src/lib/grids/grid-base.directive.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7836,11 +7836,11 @@ export abstract class IgxGridBaseDirective implements GridType,
78367836
const keepActionStrip =
78377837
!!context?.pinned &&
78387838
!!contextEl?.isConnected &&
7839-
!!contextEl?.matches?.(':hover');
7839+
!!context?.asMenuItems;
78407840

78417841
if (!keepActionStrip) {
7842-
this.actionStrip?.hide();
78437842
if (this.actionStrip) {
7843+
this.actionStrip.hide();
78447844
this.actionStrip.context = null;
78457845
}
78467846
}

0 commit comments

Comments
 (0)