Skip to content

Commit 35f040e

Browse files
committed
chore(vhelper): revert scrollwidth
1 parent c611ec5 commit 35f040e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

projects/igniteui-angular/src/lib/directives/for-of/virtual.helper.component.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Component, ElementRef, HostBinding, Input, ViewChild, ViewContainerRef,
2-
ChangeDetectorRef, OnDestroy, Inject, NgZone } from '@angular/core';
2+
ChangeDetectorRef, OnDestroy, OnInit, Inject, NgZone } from '@angular/core';
33
import { VirtualHelperBaseDirective } from './base.helper.component';
44
import { DOCUMENT } from '@angular/common';
55
import { PlatformUtil } from '../../core/utils';
@@ -9,10 +9,13 @@ import { PlatformUtil } from '../../core/utils';
99
template: '<div #container class="igx-vhelper__placeholder-content" [style.height.px]="size"></div>',
1010
standalone: true
1111
})
12-
export class VirtualHelperComponent extends VirtualHelperBaseDirective implements OnDestroy {
12+
export class VirtualHelperComponent extends VirtualHelperBaseDirective implements OnInit, OnDestroy {
1313
@HostBinding('scrollTop')
1414
public scrollTop;
1515

16+
@HostBinding('style.width.px')
17+
public scrollWidth;
18+
1619
@HostBinding('style.--vhelper-scrollbar-size')
1720
public get scrollbarSize(): string {
1821
const value = `${this.scrollNativeSize}px`;
@@ -30,6 +33,10 @@ export class VirtualHelperComponent extends VirtualHelperBaseDirective implement
3033
super(elementRef, cdr, zone, document, platformUtil);
3134
}
3235

36+
public ngOnInit() {
37+
this.scrollWidth = this.scrollNativeSize;
38+
}
39+
3340
protected override restoreScroll() {
3441
this.nativeElement.scrollTop = this.scrollAmount;
3542
}

0 commit comments

Comments
 (0)