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

Discrete Slider? #47

Closed
vgoklani opened this issue Nov 21, 2015 · 2 comments
Closed

Discrete Slider? #47

vgoklani opened this issue Nov 21, 2015 · 2 comments

Comments

@vgoklani
Copy link

My code was previously working, but it seems the changes in 3.0 have broken a few things, as I can no longer get a discrete slider.

Is this now the correct way of defining the marks object?

marks:{"0":"8-HR", "33":"1-Day", "66":"3-Day", "100":"7-Day"}

and should "included" be set to false? This is still giving me a continous slider:
<Slider onChange={that.handleChange.bind(that, d.field)} key={"3sliderDiscrete"} included={false} marks={d.marks} />

@benjycui
Copy link
Member

Set step={null}. See: https://github.com/react-component/slider#props

Actually, you can set min={0} max={3}, and then marks={0: "8-HR", 1: "1-Day", 2: "3-Day", 3: "7-Day"}. This will be more elegant.

@vgoklani
Copy link
Author

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants