Skip to content
This repository was archived by the owner on Dec 19, 2024. It is now read-only.

Conversation

@danbeam
Copy link
Contributor

@danbeam danbeam commented May 17, 2017

Fixes #190

@danbeam danbeam requested a review from keanulee May 17, 2017 00:19
},

attached: function() {
this._isRTL = window.getComputedStyle(this)['direction'] === 'rtl';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The getComputedStyle() in attached is costly, and could degrade performance significantly especially if there are multiple instances of this element. Don't know of any alternatives tho - thoughts @frankiefu?

Copy link
Contributor

@frankiefu frankiefu May 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, as @keanulee points out getComputedStyle will force layout and so not really ideal here. There is :dir() CSS pseudo-class which will solve this problem but it's not implemented in Chrome yet. So without :dir or host-context one workaround is to manually check for dir attribute on the parent and the body. @sorvell did a quick prototype on this: https://glitch.com/edit/#!/fern-scarf

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@frankiefu yep, I know about :dir() and how it doesn't work in Chrome yet.

Did you read the bug? #190 it talks about how just checking [dir] is not good enough.

Copy link
Contributor

@frankiefu frankiefu May 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately without better platform support this is the limitation we have to endure without sacrificing performance. It seems to me the biggest issue is currently there is no way to force the direction of the slider to be LTR when the page's has a dir="rtl". I'd suggest we just make it to support if someone wants to override the dir it has to be set on paper-slider <paper-slider dir="ltr">.

@keanulee
Copy link
Contributor

keanulee commented Jun 27, 2017

See #199, which covers some of this functionality

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants