11import { Component , ElementRef , HostBinding , Input , ViewChild , ViewContainerRef ,
2- ChangeDetectorRef , OnDestroy , Inject , NgZone } from '@angular/core' ;
2+ ChangeDetectorRef , OnDestroy , OnInit , Inject , NgZone } from '@angular/core' ;
33import { VirtualHelperBaseDirective } from './base.helper.component' ;
44import { DOCUMENT } from '@angular/common' ;
55import { 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