@@ -3,7 +3,7 @@ import { IgxGridBaseDirective } from './grid-base.directive';
33import { first } from 'rxjs/operators' ;
44import { IgxColumnComponent } from './columns/column.component' ;
55import { IgxGridNavigationService } from './grid-navigation.service' ;
6- import { HORIZONTAL_NAV_KEYS } from '../core/utils' ;
6+ import { HORIZONTAL_NAV_KEYS , HEADER_KEYS } from '../core/utils' ;
77
88/** @hidden */
99@Injectable ( )
@@ -214,14 +214,15 @@ export class IgxGridMRLNavigationService extends IgxGridNavigationService {
214214
215215 headerNavigation ( event : KeyboardEvent ) {
216216 const key = event . key . toLowerCase ( ) ;
217+ if ( ! HEADER_KEYS . has ( key ) ) { return ; }
218+ event . preventDefault ( ) ;
217219 if ( ! this . activeNode . layout ) {
218220 this . activeNode . layout = this . layout ( this . activeNode . column || 0 ) ;
219221 }
220222 const alt = event . altKey ;
221223 const ctrl = event . ctrlKey ;
222224 this . performHeaderKeyCombination ( this . grid . getColumnByVisibleIndex ( this . activeNode . column ) , key , event . shiftKey , ctrl , alt ) ;
223225 if ( ! ctrl && ! alt && ( key . includes ( 'down' ) || key . includes ( 'up' ) ) ) {
224- event . preventDefault ( ) ;
225226 const children = this . parentByChildIndex ( this . activeNode . column ) . children ;
226227 const col = key . includes ( 'down' ) ? this . getNextRowIndex ( children , false ) : this . getPreviousRowIndex ( children , false ) ;
227228 if ( ! col ) { return ; }
@@ -236,7 +237,6 @@ export class IgxGridMRLNavigationService extends IgxGridNavigationService {
236237 protected horizontalNav ( event : KeyboardEvent , key : string , rowIndex : number ) {
237238 const ctrl = event . ctrlKey ;
238239 if ( ! HORIZONTAL_NAV_KEYS . has ( key ) || event . altKey ) { return ; }
239- event . preventDefault ( ) ;
240240 this . activeNode . row = rowIndex ;
241241 if ( ( key . includes ( 'left' ) || key === 'home' ) && this . activeNode . column > 0 ) {
242242 this . activeNode . column = ctrl || key === 'home' ? this . firstIndexPerRow : this . getNextHorizontalCellPosition ( true ) . column ;
0 commit comments