Skip to content

Commit

Permalink
Refactor #16793 - ScrollPanel
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Nov 28, 2024
1 parent 3b191b4 commit 03e9e67
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/primeng/src/scrollpanel/scrollpanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ export class ScrollPanel extends BaseComponent implements AfterViewInit, OnDestr
xBar.setAttribute('data-p-scrollpanel-hidden', 'false');
removeClass(xBar, 'p-scrollpanel-hidden');
const xBarWidth = Math.max((this.scrollXRatio as number) * 100, 10);
const xBarLeft = (content.scrollLeft * (100 - xBarWidth)) / (totalWidth - ownWidth);
xBar.style.cssText = 'width:' + xBarWidth + '%; left:' + xBarLeft + '%;bottom:' + bottom + 'px;';
const xBarLeft = Math.abs((content.scrollLeft * (100 - xBarWidth)) / (totalWidth - ownWidth));
xBar.style.cssText = 'width:' + xBarWidth + '%; inset-inline-start:' + xBarLeft + '%;bottom:' + bottom + 'px;';
}

if ((this.scrollYRatio as number) >= 1) {
Expand All @@ -220,7 +220,7 @@ export class ScrollPanel extends BaseComponent implements AfterViewInit, OnDestr
removeClass(yBar, 'p-scrollpanel-hidden');
const yBarHeight = Math.max((this.scrollYRatio as number) * 100, 10);
const yBarTop = (content.scrollTop * (100 - yBarHeight)) / (totalHeight - ownHeight);
yBar.style.cssText = 'height:' + yBarHeight + '%; top: calc(' + yBarTop + '% - ' + xBar.clientHeight + 'px);right:' + right + 'px;';
yBar.style.cssText = 'height:' + yBarHeight + '%; top: calc(' + yBarTop + '% - ' + xBar.clientHeight + 'px); inset-inline-end:' + right + 'px;';
}
});
this.cd.markForCheck();
Expand Down

0 comments on commit 03e9e67

Please sign in to comment.