Skip to content

Commit de03ea1

Browse files
authored
Merge pull request #7205 from IgniteUI/ddincheva/kbChangeLog
Keyboard Navigation Changelog update
2 parents b402d4d + 00817f4 commit de03ea1

File tree

6 files changed

+21
-9
lines changed

6 files changed

+21
-9
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,18 @@ All notable changes for each version of this project will be documented in this
6464
- `deselectColumns` API method is added for the `IgxGrid`. It allows to deselect columns by passing array of IgxColumnComponent or column fields.
6565
- `deselectAllColumns` API method is added for the `IgxGrid`. It allows to deselect all columns.
6666
- `getSelectedColumnsData` API method is added for the `IgxGrid`. It allows to get the selected columns data.
67+
Added keyBoard navigation support in the IgxGrid headers. Now is possible to navigate with the arrows keys through grid headers. Also we provide a number of key combinations that trigger a different column functionality like filtering, sorting, grouping and etc. You can read more information in the [Grid Specification](https://github.com/IgniteUI/igniteui-angular/wiki/igxGrid-Specification#kb-navigation).
68+
- **Behavioral Change**
69+
- *you can not use* `tab` key to navigate between the cell in the Igx Grid. The navigation is performed only with arrow keys.
70+
- when you are in edit mode with `tab` key you can navigate to the next editable cell.
71+
- `page up` and `page down` keys will perform action only if the focused element is the tbody of the grid.
72+
- The grid introduces the following basic `tab stops`:
73+
- Toolbar / Group by Area if existing;
74+
- The first cell in the header row;
75+
- The first cell in the first body row;
76+
- The first cell in column summary if exists;
77+
- Pager UI;
78+
- `onGridKeydown` event is deprecated. Now you can directly bind to keydown on the IgxGrid component in order to perform custom keyboard navigation.
6779

6880
- `IgxCombo`:
6981
- Added `autoFocusSearch` input that allows to manipulate the combo's opening behavior. When the property is `true` (by default), the combo's search input is focused on open. When set to `false`, the focus goes to the combo items container, which can be used to prevent the software keyboard from activating on mobile devices when opening the combo.

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { IForOfState } from '../../directives/for-of/for_of.directive';
1010
import { IgxColumnComponent } from '../columns/column.component';
1111
import { IFilteringOperation } from '../../data-operations/filtering-condition';
1212
import { GridBaseAPIService } from '../api.service';
13-
import { IColumnVisibilityChangedEventArgs } from '../grid';
1413
import { IColumnResizeEventArgs } from '../common/events';
1514
import { GridType } from '../common/grid.interface';
1615
import { IgxDatePipeComponent } from '../common/pipes';
@@ -20,7 +19,6 @@ import { useAnimation } from '@angular/animations';
2019
import { fadeIn, fadeOut } from '../../animations/main';
2120
import { ExcelStylePositionStrategy } from './excel-style/excel-style-position-strategy';
2221
import { AbsoluteScrollStrategy } from '../../services/overlay/scroll/absolute-scroll-strategy';
23-
import { IgxGridExcelStyleFilteringComponent } from './excel-style/grid.excel-style-filtering.component';
2422

2523
const FILTERING_ICONS_FONT_SET = 'filtering-icons';
2624

@@ -69,7 +67,7 @@ export class IgxFilteringService implements OnDestroy {
6967
this.destroy$.complete();
7068
}
7169

72-
public toggleFilterDropdown(element, column) {
70+
public toggleFilterDropdown(element, column, classRef) {
7371
if (!this._componentOverlayId || (this.column && this.column.field !== column.field)) {
7472
this.column = column;
7573
const filterIcon = this.column.filteringExpressionsTree ? 'igx-excel-filter__icon--filtered' : 'igx-excel-filter__icon';
@@ -78,7 +76,7 @@ export class IgxFilteringService implements OnDestroy {
7876
this._filterMenuOverlaySettings.positionStrategy.settings.target = filterIconTarget;
7977
this._filterMenuOverlaySettings.outlet = (this.grid as any).outlet;
8078
this._componentOverlayId =
81-
this._overlayService.attach(IgxGridExcelStyleFilteringComponent, this._filterMenuOverlaySettings, this._moduleRef);
79+
this._overlayService.attach(classRef, this._filterMenuOverlaySettings, this._moduleRef);
8280
this._overlayService.show(this._componentOverlayId, this._filterMenuOverlaySettings);
8381
}
8482
}
@@ -98,7 +96,7 @@ export class IgxFilteringService implements OnDestroy {
9896
this._overlayService.onOpening.pipe(
9997
filter((overlay) => overlay.id === this._componentOverlayId),
10098
takeUntil(this.destroy$)).subscribe((eventArgs) => {
101-
const instance = eventArgs.componentRef.instance as IgxGridExcelStyleFilteringComponent;
99+
const instance = eventArgs.componentRef.instance as any;
102100
if (instance) {
103101
instance.initialize(this.column, this._overlayService, eventArgs.id);
104102
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { IgxGridBaseDirective } from './grid-base.directive';
77
import { IMultiRowLayoutNode } from './selection/selection.service';
88
import { GridKeydownTargetType, GridSelectionMode, FilterMode } from './common/enums';
99
import { SortingDirection } from '../data-operations/sorting-expression.interface';
10+
import { IgxGridExcelStyleFilteringComponent } from './filtering/excel-style/grid.excel-style-filtering.component';
1011
export interface ColumnGroupsCache {
1112
level: number;
1213
visibleIndex: number;
@@ -169,7 +170,7 @@ export class IgxGridNavigationService {
169170
if (ctrl && shift && key === 'l' && this.grid.allowFiltering && !column.columnGroup && column.filterable) {
170171
if (this.grid.filterMode === FilterMode.excelStyleFilter) {
171172
const headerEl = this.grid.nativeElement.querySelector(`.igx-grid__th--active`);
172-
this.grid.filteringService.toggleFilterDropdown(headerEl, column);
173+
this.grid.filteringService.toggleFilterDropdown(headerEl, column, IgxGridExcelStyleFilteringComponent);
173174
} else {
174175
this.performHorizontalScrollToCell(column.visibleIndex);
175176
this.grid.filteringService.filteredColumn = column;

projects/igniteui-angular/src/lib/grids/grid/expandable-cell.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<ng-container *ngIf="showExpanderIndicator">
3232
<div #indicator
3333
class="igx-grid__tree-grouping-indicator"
34-
(click)="toggle($event)" (focus)="onIndicatorFocus()" tabindex="-1">
34+
(click)="toggle($event)" (focus)="onIndicatorFocus()">
3535
<ng-container *ngTemplateOutlet="iconTemplate; context: { $implicit: this }">
3636
</ng-container>
3737
</div>

projects/igniteui-angular/src/lib/grids/headers/grid-header.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { IgxColumnResizingService } from '../resizing/resizing.service';
2020
import { Subject } from 'rxjs';
2121
import { GridType } from '../common/grid.interface';
2222
import { GridSelectionMode } from '../common/enums';
23+
import { IgxGridExcelStyleFilteringComponent } from '../filtering/excel-style/grid.excel-style-filtering.component';
2324

2425
/**
2526
* @hidden
@@ -182,7 +183,7 @@ export class IgxGridHeaderComponent implements DoCheck, OnInit, OnDestroy {
182183

183184

184185
public onFilteringIconClick(event) {
185-
this.grid.filteringService.toggleFilterDropdown(this.elementRef.nativeElement, this.column);
186+
this.grid.filteringService.toggleFilterDropdown(this.elementRef.nativeElement, this.column, IgxGridExcelStyleFilteringComponent);
186187
}
187188

188189
get grid(): any {

projects/igniteui-angular/src/lib/grids/tree-grid/tree-cell.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
*ngIf="!isLoading"
3737
class="igx-grid__tree-grouping-indicator"
3838
[ngStyle]="{'visibility': showIndicator ? 'visible' : 'hidden'}"
39-
(click)="toggle($event)" (focus)="onIndicatorFocus()" tabindex="-1">
39+
(click)="toggle($event)" (focus)="onIndicatorFocus()">
4040
<ng-container *ngTemplateOutlet="iconTemplate; context: { $implicit: this }">
4141
</ng-container>
4242
<ng-container *ngTemplateOutlet="pinnedIndicatorTemplate; context: context">

0 commit comments

Comments
 (0)