Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rtl text direction support #139

Closed
olafcm opened this issue Feb 9, 2018 · 3 comments
Closed

rtl text direction support #139

olafcm opened this issue Feb 9, 2018 · 3 comments

Comments

@olafcm
Copy link

olafcm commented Feb 9, 2018

Is it possible to enable text direction support?
The library works perfectly since it relies on the browsers native scrollbars so the only issue here is in the CSS, which means based on the text direction (which can be detected by doing for example getComputedStyle( document.getElementsByClassName( "simplebar-content" )[0] ).direction;) padding-right with padding-left (

this.scrollContentEl.style.paddingRight = `${this.scrollbarWidth || this.offsetSize}px`;
) and margin-right with margin-left (
this.contentEl.style.marginRight = `-${this.scrollbarWidth}px`;
) on init.

@Grsmto
Copy link
Owner

Grsmto commented Feb 9, 2018

Hi @broodjekipburger
I think it's tricky to detect this automatically as the direction css property could potentially be applied higher in the DOM and cascading so Simplebar could miss it right?
Maybe having an option in the plugin to define the direction would then be a better solution?

Edit: after testing actually you're right, getComputedStyle should do the job well!

@olafcm
Copy link
Author

olafcm commented Mar 12, 2018

Thanks!!

@mrg0lden
Copy link

simplebar-track is still on the right side on RTL mode even though we get padding-left

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants