Skip to content

Commit b17c867

Browse files
committed
refactor(vhelper): update implementation
1 parent 0b0e6ad commit b17c867

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

projects/igniteui-angular/src/lib/core/styles/components/drop-down/_drop-down-theme.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@
244244
position: relative;
245245

246246
igx-display-container {
247-
padding-inline-end: var(--vhelper-scrollbar-size, 0)
247+
padding-inline-end: var(--vhelper-scrollbar-size);
248248
}
249249
}
250250

projects/igniteui-angular/src/lib/core/styles/themes/_core.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@
125125
}
126126

127127
@property --vhelper-scollbar-size {
128-
syntax: '<integer>';
129-
initial-value: 0;
128+
syntax: '<length>';
129+
initial-value: 16px;
130130
inherits: true;
131131
}
132132

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

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,8 @@ export class VirtualHelperComponent extends VirtualHelperBaseDirective implement
1313
@HostBinding('scrollTop')
1414
public scrollTop;
1515

16-
@HostBinding('style.width.px')
1716
public scrollWidth;
1817

19-
@HostBinding('style.--vhelper-scrollbar-size')
20-
public get scrollbarSize(): string {
21-
const value = `${this.scrollNativeSize}px`;
22-
this.document.documentElement.style.setProperty('--vhelper-scrollbar-size', value);
23-
return value;
24-
}
25-
2618
@ViewChild('container', { read: ViewContainerRef, static: true }) public _vcr;
2719
@Input() public itemsLength: number;
2820

@@ -35,6 +27,10 @@ export class VirtualHelperComponent extends VirtualHelperBaseDirective implement
3527

3628
public ngOnInit() {
3729
this.scrollWidth = this.scrollNativeSize;
30+
this.document.documentElement.style.setProperty(
31+
'--vhelper-scrollbar-size',
32+
`${this.scrollNativeSize}px`
33+
);
3834
}
3935

4036
protected override restoreScroll() {

0 commit comments

Comments
 (0)