Skip to content

Commit e6d2dc2

Browse files
committed
fix(IgxGrid): return the active node when perform filtering #7337
1 parent 10350d3 commit e6d2dc2

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

projects/igniteui-angular/src/lib/grids/filtering/advanced-filtering/advanced-filtering-dialog.component.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,11 @@ export class IgxAdvancedFilteringDialogComponent implements AfterViewInit, OnDes
129129
*/
130130
public searchValue: any;
131131

132+
/**
133+
* @hidden @internal
134+
*/
135+
public lastActiveNode;
136+
132137
private _positionSettings = {
133138
horizontalStartPoint: HorizontalAlignment.Right,
134139
verticalStartPoint: VerticalAlignment.Top
@@ -1075,6 +1080,7 @@ export class IgxAdvancedFilteringDialogComponent implements AfterViewInit, OnDes
10751080
if (this._overlayComponentId) {
10761081
this._overlayService.hide(this._overlayComponentId);
10771082
}
1083+
this.grid.navigation.activeNode = this.lastActiveNode;
10781084
if (this.grid.navigation.activeNode && this.grid.navigation.activeNode.row === -1) {
10791085
(this.grid as any).theadRow.nativeElement.focus();
10801086
}

projects/igniteui-angular/src/lib/grids/filtering/grid-filtering.service.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ export class IgxFilteringService implements OnDestroy {
4646
private columnToExpressionsMap = new Map<string, ExpressionUI[]>();
4747
private _datePipe: IgxDatePipeComponent;
4848
private columnStartIndex = -1;
49-
private _filterIconsRegistered = false;
5049
private _componentOverlayId: string;
5150
private _filterMenuPositionSettings: PositionSettings;
5251
private _filterMenuOverlaySettings: OverlaySettings;
5352
private column;
53+
private lastActiveNode;
5454

5555
public isFilterRowVisible = false;
5656
public filteredColumn: IgxColumnComponent = null;
@@ -98,6 +98,7 @@ export class IgxFilteringService implements OnDestroy {
9898
takeUntil(this.destroy$)).subscribe((eventArgs) => {
9999
const instance = eventArgs.componentRef.instance as any;
100100
if (instance) {
101+
this.lastActiveNode = this.grid.navigation.activeNode;
101102
instance.initialize(this.column, this._overlayService, eventArgs.id);
102103
}
103104
});
@@ -106,6 +107,7 @@ export class IgxFilteringService implements OnDestroy {
106107
filter(overlay => overlay.id === this._componentOverlayId),
107108
takeUntil(this.destroy$)).subscribe(() => {
108109
this._componentOverlayId = null;
110+
this.grid.navigation.activeNode = this.lastActiveNode;
109111
this.grid.theadRow.nativeElement.focus();
110112
});
111113
}

0 commit comments

Comments
 (0)