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

The ux-slider has incorrect appearance and behaviour then RTL (dir="rtl") is enabled #318

Open
glyad opened this issue Jul 20, 2020 · 2 comments

Comments

@glyad
Copy link

glyad commented Jul 20, 2020

I'm submitting a bug report

Library Version:
latest

Operating System:
macOS 10.15.5 Catalina

Node Version:
10.19.0

NPM Version:
6.14.6

Webpack
Latest

Browser:
Chrome Latest

Language:
TypeScript 3.9.5

Current appearance (buggy):
image

Desired appearance:
With appropriate margin from right.

Current behaviour:
The reaction to mouse events becomes "inverted" then the document has RTL direction.

Screen Recording 2020-07-20 at 12 38 59

@bigopon
Copy link
Member

bigopon commented Jul 21, 2020

@ben-girardet any thoughts on tackling this one?

@ben-girardet
Copy link
Contributor

Good question 👍🏻

Probably need to detect RTL with something like:

window.getComputedStyle(this.element, null).getPropertyValue('direction')

and if RTL invert the slider position.

However this assumes that RTL is defined in CSS which might not be the only way to do so. I think one can also use the dir HTML attribute...

Anybody familiar with RTL and how to properly "detect" it from JavaScript ?

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

No branches or pull requests

3 participants