mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[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:
@@ -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
|
||||
});
|
||||
});
|
||||
|
||||
|
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user