-
Notifications
You must be signed in to change notification settings - Fork 3.4k
feat(slider): md-reverse #7667
feat(slider): md-reverse #7667
Conversation
Very well implemented. LGTM. @EladBezalel Do we want to support this? |
} | ||
|
||
function valueToPercent( val ) { | ||
return (val - min)/(max - min); | ||
var percent = (val - min)/(max - min); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one little thing (nitpicky): The arithmetic operator should be spaced, just to be consistent.
@soooooot thanks for this, please next time open an issue just to make order, thanks again, LGTM. @devversion do you mind manual test it? |
@EladBezalel I fired an issue here issue #7666, next time I will mark it clear if I have a PR to create. There's a CodePen link posted in issue, maybe it can help you guys to manual test it. I will fix the points you mentioned. |
9814b0f
to
0107f0f
Compare
@EladBezalel Just tested it locally and it works like a charm. |
I'd like to have a bit more discussion about this before we merge it. I'm not opposed to adding this functionality, but I think the terminology "reverse" is a bit confusing and would like to discuss some other options. When I first saw this PR, I assumed it meant that the entire component would be reversed as if it were being used in an RTL setting. However, visually, the slider works identically to the existing slider, it's just that it counts downward with the value instead of upward. So, rather than @EladBezalel @devversion Thoughts? |
Oh, isn't that as RTL? |
@topherfangio Yes, |
@EladBezalel In my mind, RTL would start the slider at the right all grey, and the accent color (pink in our demo) would grow from the right to the left. Currently, it's still left-to-right even in reverse: That said, I unfortunately don't know much about how visual elements are represented in RTL cultures. @devversion I worry that without the |
I have no any experience on RTL too. I describe my use-case FYI. what I wanna do is a vertical, value increasing top-to-down, pagination slider. unfortunately the current md-slider does not support it. For such a small code change, I have to copy all the md-slider js code and paste it to another new that's my story. |
For reference, this is how I assume the RTL slider would work: http://demos.telerik.com/kendo-ui/slider/right-to-left-support If you can update this PR to use |
0107f0f
to
748b83b
Compare
it seems like I made a new CodePen to make it visual reversed( the accent pink part) just like the demo @topherfangio posted. And I also updated the PR, so you guys can check the changes or you can check on my personal branch commit to get the visual part changes. I didn't change the name yet, since we should rename it depends on the behaviour right? |
@soooooot If we implement real RTL support, could you use it on just that single slider for your purposes? If so, I think that would definitely be a better solution. |
@topherfangio yep, I think RTL single slider can implement a pagination slider. The PR I updated yesterday did implement the RTL feature in my opinion, or I missed something? |
@soooooot Sorry for the delay (was on vacation). True RTL support just looks at the For instance, it should work if you did something like this: <div dir="rtl">
<md-slider min="0" max="255"></md-slider>
</div> @EladBezalel Does this sound correct to you? |
@topherfangio it won't work, the dir attribute is only taking place with our code if it's being applied on body or html.. |
@topherfangio After some days to think about the issue again, I found that even in @EladBezalel I have a rough idea to make 'md-invert' to work with I will rename it as soon as I see your reply with a confirmed name. |
@soooooot I think @EladBezalel Are you sure about RTL on body only? When I just tested it, all I did was add |
@topherfangio so i guess it's fixed, rtl mixin was once only on html and body.. good for us! :D also |
md-invert: make min value to top/right and max value to bottom/left Closes angular#7666
748b83b
to
98bbc28
Compare
This issue is closed as part of our ‘Surge Focus on Material 2' efforts. |
make min value to top/right, max value to bottom/left, details on #7666