Skip to content

Commit

Permalink
fix(cdk): Scrollbar fix scroll behaviour (#7594)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimirpotekhin committed Jun 2, 2024
1 parent de88842 commit 10fe5a3
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,15 @@ export class TuiScrollbarDirective {
)
.pipe(tuiZonefree(zone), takeUntil(destroy$))
.subscribe(([scrollTop, scrollLeft]) => {
this.element.style.scrollBehavior = 'auto';

if (this.tuiScrollbar === 'vertical') {
this.element.scrollTop = scrollTop;
} else {
this.element.scrollLeft = scrollLeft;
}

this.element.style.scrollBehavior = '';
});

merge(
Expand Down Expand Up @@ -130,7 +134,7 @@ export class TuiScrollbarDirective {
: Math.ceil((clientWidth / scrollWidth) * 100) / 100;
}

private get element(): Element {
private get element(): HTMLElement {
return this.container.nativeElement;
}

Expand Down

0 comments on commit 10fe5a3

Please sign in to comment.