Skip to content
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

[Slider] Add Range input #779

Closed
isergey opened this issue Jun 7, 2015 · 28 comments · Fixed by #15703
Closed

[Slider] Add Range input #779

isergey opened this issue Jun 7, 2015 · 28 comments · Fixed by #15703
Assignees
Labels
component: slider This is the name of the generic UI component, not the React module! new feature New feature or request priority: important This change can make a difference
Milestone

Comments

@isergey
Copy link

isergey commented Jun 7, 2015

Hi!
I found slider, but I did not see how to make a from-to value selection. Does the material-ui support this behavior?
Thanks for the excellent library!

@hai-cea hai-cea changed the title Range input [Slider] Add Range input Jun 19, 2015
@shaurya947 shaurya947 added the new feature New feature or request label Nov 13, 2015
@treylon
Copy link

treylon commented Apr 6, 2016

Are there any plans on implementing this feature in the near future?

@0xn3bs
Copy link

0xn3bs commented Jul 30, 2016

I'm also interested in this feature. Range sliders are very useful as filter criteria.

@jdelafon
Copy link

jdelafon commented Aug 5, 2016

Me too!
Although impractical, it is probably possible to get the same result by combining 2 simple sliders, changing their size/range dynamically in a way that is not noticeable by the user thanks to custom CSS.

Edit: I'd propose an implementation of that if only it was possible to get the new value from event onDragStop.

@smeijer
Copy link

smeijer commented Aug 6, 2016

I couldn't believe this component did not exists. Would be most welcome if it was available.

@rikur
Copy link

rikur commented Aug 10, 2016

Please add a range support to slider.

@ghost
Copy link

ghost commented Aug 11, 2016

For now you can forget it, to make it work properly someone would need separate the SliderHandle and the SliderBar from the current Slider implementation.. This is an one to one api, not one-to-many.. This would require a lot of work. So I guess, it's simpler to use a component which can do it already like this one: https://github.com/davidchin/react-input-range

@jdelafon
Copy link

jdelafon commented Aug 11, 2016

I don't agree, and I almost made it. I only need onDragStop to return the event in the callback (#4926), and it's done. Make a component that contains 2 Slider components, superposed, each with a different callback prop, with the size and number of ticks of each depending on the value of the other (update only onDragStop).

@oliviertassinari oliviertassinari added the component: slider This is the name of the generic UI component, not the React module! label Dec 18, 2016
@cesarho
Copy link

cesarho commented Dec 27, 2016

Is your implementation working? Is it going to be contributed to the material-ui core version?

@oallouch
Copy link

Any news on this ? Is it planned for "next" ?

@mbifulco
Copy link

I could also really use a this type of input. @jdelafon - what's the state of your control? Is it available for wider use?

@jdelafon
Copy link

Well #4926 is still open, and the related pull request not merged yet apparently. At the time I gave up on it because of that, and also simply because actually two separate sliders were better for my use-case.
But the idea is simple enough, I think. Superpose two single sliders and make the length and number of ticks of the first react on the value of the second (on drag stop), and conversely.
I still have a trace of it in an old commit somewhere. I could submit a prototype if the API now allows it.

@oallouch
Copy link

FYI, I use (and like) this one: https://github.com/react-component/slider
I particularly enjoy their "pushable" property.

@dav-ell
Copy link

dav-ell commented Aug 18, 2017

I could really use this as well. The system I use does not easily support rc-slider, the slider mentioned by @oallouch.

Edit: looks like its in v1. Looking forward to that version.

@x5engine
Copy link

not good better have a properly set component than trying to hack around it

@jdelafon
Copy link

@meteorplus What are you calling "properly set"? "Not contributed by the community"?
The current state is that my request has been closed in favor of #4793 , so waiting for that one.

@AllanTAP

This comment has been minimized.

@bhack
Copy link

bhack commented Jul 14, 2018

rc-slider has a very nice feature set. Can we take inspiration from it?

@AllanTAP
Copy link

@bhack thank you for this tip! I've decided to use react-slider, and it's working just fine until now.

@adeelibr
Copy link
Contributor

adeelibr commented Sep 1, 2018

@oliviertassinari Since we have a slider, should this issue be closed?

@oliviertassinari
Copy link
Member

@adeelibr we don't have the from to feature.

@Jaichand
Copy link

Jaichand commented Sep 6, 2018

@benneq
Copy link
Contributor

benneq commented Jan 25, 2019

I'd go for a more generic solution, without any additional constraints:

<Slider
  value={50}
  onChange={(value) => ... } // will contain the single value
/>

and:

<Slider
  multi={true}
  value={[10,20,100,100]}
  onChange={(value) => ... } // will contain the complete array of values
/>

Then it's possible to have multiple values, and it's up to the user / dev to apply constraints if they wish.

@ankithkonda

This comment has been minimized.

@oliviertassinari oliviertassinari added the priority: important This change can make a difference label Mar 18, 2019
@cyberdude
Copy link

Wow. +200000000

@oliviertassinari
Copy link
Member

@cyberdude Moving the Slider to the core and implementing range will be one of our top priorities after the release of Material-UI v4.

@niksajanjic
Copy link

I might be missing something, but I don't see why is this closed. In the documentation, there is no example of Slider as a form element which is exactly what this issue is about. There is only an example of a Slider with input, which is irrelevant in this case.

Furthermore, you can't pass inputRef nor inputProps to it to be able to connect it to something like react-hook-form easily. I can see input element inside slider, so it just seems like we're close but not there yet.

@oliviertassinari
Copy link
Member

oliviertassinari commented May 29, 2020

@niksajanjic Wrong issue, this one is about:

Capture d’écran 2020-05-29 à 10 33 43

@niksajanjic

This comment has been minimized.

@mui mui locked as resolved and limited conversation to collaborators May 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
component: slider This is the name of the generic UI component, not the React module! new feature New feature or request priority: important This change can make a difference
Projects
None yet
Development

Successfully merging a pull request may close this issue.