Skip to content

Commit e6c4c3e

Browse files
authored
Merge pull request #6349 from IgniteUI/mkirova/fix-6315
fix(igxGrid): Refactoring goToFirstCell func so that it scrolls verti…
2 parents c728aa7 + 3038f13 commit e6c4c3e

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

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

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -356,21 +356,15 @@ export class IgxGridNavigationService {
356356

357357
public goToFirstCell() {
358358
const verticalScroll = this.grid.verticalScrollContainer.getScroll();
359-
const horizontalScroll = this.grid.dataRowList.first.virtDirRow.getScroll();
360359
if (verticalScroll.scrollTop === 0) {
361360
this.onKeydownHome(this.grid.dataRowList.first.index);
362361
} else {
363-
if (!horizontalScroll.clientWidth || parseInt(horizontalScroll.scrollLeft, 10) <= 1 || this.grid.pinnedColumns.length) {
364-
this.navigateTop(0);
365-
} else {
366-
this.getFocusableGrid().nativeElement.focus({ preventScroll: true });
367-
this.horizontalScroll(this.grid.dataRowList.first.index).scrollTo(0);
368-
this.grid.parentVirtDir.onChunkLoad
369-
.pipe(first())
370-
.subscribe(() => {
371-
this.navigateTop(0);
372-
});
373-
}
362+
this.getFocusableGrid().nativeElement.focus({ preventScroll: true });
363+
this.grid.verticalScrollContainer.scrollTo(0);
364+
this.grid.verticalScrollContainer.onChunkLoad
365+
.pipe(first()).subscribe(() => {
366+
this.onKeydownHome(this.grid.dataRowList.first.index);
367+
});
374368
}
375369
}
376370

0 commit comments

Comments
 (0)