paper-slider icon indicating copy to clipboard operation
paper-slider copied to clipboard

paper-slider only respects [dir=rtl] but not direction: ltr; in CSS nor nested [dir]

Open danbeam opened this issue 7 years ago • 3 comments

Description

paper-slider added RTL support via :host-context([dir="rtl"]) in https://github.com/PolymerElements/paper-slider/pull/181

This is super, except there are a few ways of changing text direction that it doesn't detect.

For example:

paper-slider {
  direction: rtl;
}

or

<html dir="rtl">
<paper-slider dir="ltr">

Expected outcome

Slider's direction and effective text direction agree.

Actual outcome

In some cases, the slider direction differs from the text direction.

Live Demo

https://jsfiddle.net/7qxd7cjx/

Steps to reproduce

  1. plop <paper-slider style="direction: rtl;"> or <div dir=rtl><paper-slider dir=ltr> onto a page
  2. slide the knob

Browsers Affected

  • [X] Chrome
  • [X] Firefox
  • [X] Safari 9
  • [X] Safari 8
  • [X] Safari 7
  • [X] Edge
  • [X] IE 11
  • [X] IE 10

(Note: I assume this applies to all browsers but haven't actually checked).

/cc @dschuyler @keanulee

danbeam avatar May 16 '17 23:05 danbeam

Am I right to assume that @danbeam will no longer be working on this bug? In that case, could someone else take over? I want to force the sliders to be LTR in the Cast dialog WebUI in Chromium, and can do so with a local CSS workaround like the one below, but I'd be happier if such a workaround wasn't necessary.

:host-context([dir="rtl"]) paper-slider[dir="ltr"] {
  -webkit-transform: scaleX(-1);
  transform: scaleX(-1);
}

takumif avatar Jun 27 '17 01:06 takumif

@takumif I added a new CSS rule to paper-slider that should help you with that issue - specifically as long as you have dir="ltr" on paper-slider it should override the other rule.

keanulee avatar Jun 27 '17 18:06 keanulee

Great, thank you!

takumif avatar Jun 27 '17 20:06 takumif