I have been working on implementing Right-to-Left (RTL) support for scrolling using the ngx-scrollbar package in my Angular project. Unfortunately, I am facing an issue where the scrollbar does not seem to function correctly when in RTL mode.
To add ngx-scrollbar to my Angular project, I used the following command:
npm install ngx-scrollbar
In order to enable RTL mode, I included the following code snippet in my template:
<ng-scrollbar buttons [dir]="'rtl'"></ng-scrollbar>
Despite implementing this code, the scrollbar behaves incorrectly in RTL mode, although it works fine in LTR (Left-to-Right) mode.
What I Have Attempted So Far
- I referred to the ngx-scrollbar documentation and confirmed that the dir attribute should activate RTL mode.
- I tested my application's RTL support by setting other elements with dir="rtl", and they displayed as expected.
- I experimented with different browsers to eliminate any browser-specific issues.
Check out the demo on StackBlitz
Environment Details: Angular: 18.0.0 CDK/Material: 18.0.2 Browser(s): Chrome Operating System: Windows