[MNT-23648] Clicking on Load More button no longer causes scroll position to reset to top (#8951)

* [MNT-23648] Resolved issue where clicking on load more button would reset the scroll position to top when copying/moving a folder

* [MNT-23648] Revert fix

* [MNT-23648] Resolved issue where clicking on load more button would reset the scroll position to top when copying/moving a folder

* [MNT-23648] Added test case to cover new functionality

* [MNT-23648] Fixed unit tests
This commit is contained in:
swapnil-verma-gl
2023-10-03 13:21:36 +05:30
committed by GitHub
parent 0b1fc4faa4
commit e638b54fcd
4 changed files with 37 additions and 13 deletions

View File

@@ -174,7 +174,7 @@ describe('InfinitePaginationComponent', () => {
loadMoreButton.triggerEventHandler('click', {});
});
it('should trigger the loadMore event with merge false to reload all the elements', (done) => {
it('should trigger the loadMore event with merge true to reload all the elements', (done) => {
pagination = {maxItems: 444, skipCount: 25, totalItems: 55, hasMoreItems: true};
component.target.pagination.next(pagination);
@@ -184,7 +184,7 @@ describe('InfinitePaginationComponent', () => {
changeDetectorRef.detectChanges();
component.loadMore.subscribe((newPagination: RequestPaginationModel) => {
expect(newPagination.merge).toBe(false);
expect(newPagination.merge).toBe(true);
done();
});
@@ -222,7 +222,7 @@ describe('InfinitePaginationComponent', () => {
skipCount: 0,
maxItems: 50,
hasMoreItems: false,
merge: false
merge: true
});
});
@@ -237,7 +237,7 @@ describe('InfinitePaginationComponent', () => {
maxItems: 14,
skipCount: 0,
hasMoreItems: false,
merge: false
merge: true
});
});

View File

@@ -109,7 +109,7 @@ export class InfinitePaginationComponent implements OnInit, OnDestroy, Paginatio
onLoadMore() {
this.requestPaginationModel.skipCount = 0;
this.requestPaginationModel.merge = false;
this.requestPaginationModel.merge = true;
this.requestPaginationModel.maxItems += this.pageSize;