|
1 | 1 | import { Injectable } from '@angular/core'; |
2 | | -import { first } from 'rxjs/operators'; |
| 2 | +import { first, debounceTime } from 'rxjs/operators'; |
3 | 3 | import { IgxColumnComponent } from './columns/column.component'; |
4 | 4 | import { IgxGridGroupByRowComponent } from './grid/groupby-row.component'; |
5 | 5 | import { ISelectionNode } from './selection/selection.service'; |
@@ -262,7 +262,7 @@ export class IgxGridNavigationService { |
262 | 262 | this.getFocusableGrid().nativeElement.focus({ preventScroll: true }); |
263 | 263 | this.grid.verticalScrollContainer.scrollTo(targetIndex !== -1 ? targetIndex : 0); |
264 | 264 | this.grid.verticalScrollContainer.onChunkLoad |
265 | | - .pipe(first()).subscribe(() => { |
| 265 | + .pipe(debounceTime(10)).pipe(first()).subscribe(() => { |
266 | 266 | const cells = this.grid.nativeElement.querySelectorAll( |
267 | 267 | `${cellSelector}[data-visibleIndex="${visibleColumnIndex}"]`); |
268 | 268 | if (cells.length > 0) { (cells[0] as HTMLElement).focus(); } |
@@ -299,7 +299,7 @@ export class IgxGridNavigationService { |
299 | 299 | this.getFocusableGrid().nativeElement.focus({ preventScroll: true }); |
300 | 300 | this.grid.verticalScrollContainer.scrollTo(targetIndex !== -1 ? targetIndex : this.grid.dataView.length - 1); |
301 | 301 | this.grid.verticalScrollContainer.onChunkLoad |
302 | | - .pipe(first()).subscribe(() => { |
| 302 | + .pipe(debounceTime(10)).pipe(first()).subscribe(() => { |
303 | 303 | const cells = this.grid.nativeElement.querySelectorAll( |
304 | 304 | `${cellSelector}[data-visibleIndex="${visibleColumnIndex}"]`); |
305 | 305 | if (cells.length > 0) { |
|
0 commit comments