-
Notifications
You must be signed in to change notification settings - Fork 344
Implement ability to style progress of a range input #736
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
Implement ability to style progress of a range input #736
Conversation
This adds the ability to style the current progress of a range input, similar to `::-moz-range-progress`, `:-webkit-slider-runnable-track`.
bc80cdf
to
f3cca50
Compare
Very cool, I like the idea! Thanks for making a pull request. Is it working with decorators too? I am a bit busy these days, but will take a closer look at it soon. |
If you mean, you can use decorators to style it, then yes (ninepatch works fine for example). Definitely take your time, I'm in no hurry over it. |
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.
Thanks a lot for the pull request, it's a very nice addition! I like the subtle red you have added to the sample input range, the progress background gives some extra life to the element.
Overall, looks good to me code-wise, a couple smaller comments.
One issue I found is that if you press and drag the left mouse button from the progress area, then the slider doesn't move while dragging anymore. Compare this to the behavior to the right of the slider bar, where it still works as before.
I tested it in the benchmark sample, and didn't notice any significant degradation, maybe 2-3% max, but could be noise. This benchmark includes the extra decoration too, so I'm okay with this.
|
Nice, seems to work well for me now! One perhaps slight change in behavior is that the progress blocks the input.range sliderprogress {
display: none;
} But perhaps a bit confusing if the user don't know about the sliderprogress. Same thing with |
Over the weekend I'll look into reparenting the element to It won't work for active however, but I don't think that's a big issue, because the moment you click, we move |
Good idea, definitely worth investigating. Another option could be to make it zero height if height has not been explicitly set. One thing I noticed about active is that we only set it on the bar once we start dragging, so not on mouse down directly. That could be improved separately I think, it would make sense to make it active immediately while moving the bar under the mouse. But for now it's fine to ignore the active behavior here as you say. |
I made some new changes. Seems like just reparenting was sufficient to fix the hover event. Also had a quick look over the |
Thanks for continuing with the improvements! It's a bit problematic to set the |
3694bee
to
c32d263
Compare
I removed the active "fix". Considering the problem existed before, this PR was not the best place to fix it either way. |
Great, thanks! Looks good to me. And I agree, let's rather do that fix separately. It would be super helpful if you could add some quick details about these changes to the documentation as well. |
This adds the ability to style the current progress of a range input, similar to
::-moz-range-progress
,:-webkit-slider-runnable-track
.