Skip to content

Commit 7a4f82a

Browse files
authored
fix(igxForOf): Remove unnecessary scroll position re-render for horizontal scr... (#13946)
1 parent 2d6f238 commit 7a4f82a

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

projects/igniteui-angular/src/lib/directives/for-of/for_of.directive.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ describe('IgxForOf directive -', () => {
189189
expect(state.startIndex).toBe(1);
190190
});
191191

192-
it('should display the correct chunk items on resizing the container', () => {
192+
it('should display the correct chunk items on resizing the container', async() => {
193193
// initially the container's width is narrow enough to be scrollable
194194
fix.componentInstance.width = '200px';
195195
fix.componentInstance.cols = [
@@ -214,6 +214,8 @@ describe('IgxForOf directive -', () => {
214214
// the container's width is assigned as wide as to display all cols
215215
fix.componentInstance.width = '600px';
216216
fix.detectChanges();
217+
await wait(100);
218+
fix.detectChanges();
217219

218220
const secondRecChildren = fix.nativeElement.querySelectorAll(DISPLAY_CONTAINER)[1].children;
219221
for (let i = 0; i < secondRecChildren.length; i++) {

projects/igniteui-angular/src/lib/directives/for-of/for_of.directive.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,11 +1344,6 @@ export class IgxForOfDirective<T, U extends T[] = T[]> implements OnInit, OnChan
13441344
if (prevChunkSize !== this.state.chunkSize) {
13451345
this.chunkLoad.emit(this.state);
13461346
}
1347-
if (this.sizesCache && this.igxForScrollOrientation === 'horizontal') {
1348-
// Updating horizontal chunks and offsets based on the new scrollLeft
1349-
const scrollOffset = this.fixedUpdateAllElements(this.scrollPosition);
1350-
this.dc.instance._viewContainer.element.nativeElement.style.left = -scrollOffset + 'px';
1351-
}
13521347
}
13531348

13541349
/**

0 commit comments

Comments
 (0)