Closed omaraalia93 closed 1 year ago
The scrollbar will automatically change direction when you add the attribute dir="rtl"
on either html tag or body tag.
You can also change position using <ng-scrollbar position="invertY">
It didn't work as expected when I changed the 'dir' attribute on the HTML and body. I'm not sure why.
I fixed it by setting the 'dir' attribute on the main 'ng-scrollbar' element. I have 'ng-scrollbar' as the parent for the main router outlet. When I made this change, the inner 'ng-scrollbars' were also fixed.
@MurhafSousli
Adding the dir="rtl"
attribute statically to the <html>
tag is effective. However, if you change dir
attribute on the fly it might not work as expected.
@xidedix It is working in the demo, as you can see I use the dir directive from the CDK BidiModule
, maybe you can try the same
See how you can toggle RTL mode in the demo https://ngx-scrollbar.netlify.app/
@MurhafSousli Thank you for the clarification.
I would like to bring to your attention that the dir
attribute on the HTML
element is effective with ng-scrollbar
only for static pages, and it is not sufficient to dynamically alter its ltr/rtl
behavior. In such cases, the [dir]
directive comes in handy.
how to change direction to RTL or LTR of the scrollbar when i change language without reload the document.