diff --git a/paper-slider.html b/paper-slider.html index 263a793..341c547 100644 --- a/paper-slider.html +++ b/paper-slider.html @@ -91,7 +91,7 @@ outline: none; } - :host-context([dir="rtl"]) #sliderContainer { + :host([_is-r-t-l]) #sliderContainer { -webkit-transform: scaleX(-1); transform: scaleX(-1); } @@ -462,6 +462,11 @@ return []; } }, + + _isRTL: { + type: Boolean, + reflectToAttribute: true, + }, }, observers: [ @@ -483,6 +488,10 @@ 'up pageup end': '_incrementKey' }, + attached: function() { + this._isRTL = window.getComputedStyle(this)['direction'] === 'rtl'; + }, + /** * Increases value by `step` but not above `max`. * @method increment @@ -689,13 +698,6 @@ }); }, - get _isRTL() { - if (this.__isRTL === undefined) { - this.__isRTL = window.getComputedStyle(this)['direction'] === 'rtl'; - } - return this.__isRTL; - }, - _leftKey: function(event) { if (this._isRTL) this._incrementKey(event); diff --git a/test/rtl.html b/test/rtl.html index b927ae2..3467213 100644 --- a/test/rtl.html +++ b/test/rtl.html @@ -28,6 +28,20 @@ + + + + + + + +