Skip to content

Commit 173cd13

Browse files
committed
fix(grid): reset scrollAmount if bar hides #6627
1 parent 57017ef commit 173cd13

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,15 +1170,18 @@ export class IgxForOfDirective<T> implements OnInit, OnChanges, DoCheck, OnDestr
11701170
this.scrollComponent.size = totalWidth;
11711171
if (totalWidth <= parseInt(this.igxForContainerSize, 10)) {
11721172
this.scrollPosition = 0;
1173+
// Need to reset the scrollAmount value here, because horizontalScrollBar is hidden, therefore
1174+
// onScroll event handler for VirtualHelperBaseDirective will not be called
1175+
this.scrollComponent.scrollAmount = 0;
11731176
}
11741177
}
11751178
if (this.igxForScrollOrientation === 'vertical') {
11761179
this.scrollComponent.nativeElement.style.height = parseInt(this.igxForContainerSize, 10) + 'px';
11771180
this.scrollComponent.size = this._calcHeight();
11781181
if ( this.scrollComponent.size <= parseInt(this.igxForContainerSize, 10)) {
11791182
this.scrollPosition = 0;
1180-
// Need to reset the scrollAmount value here, because
1181-
// Firefox will not fire the scrollComponent scroll event handler
1183+
// Need to reset the scrollAmount value here, because verticalScrollBar is hidden, therefore
1184+
// onScroll event handler for VirtualHelperBaseDirective will not be called
11821185
this.scrollComponent.scrollAmount = 0;
11831186
}
11841187
}

0 commit comments

Comments
 (0)