Slider - use standard input element
See original GitHub issueI found several issues with the Slider component.
- Use standard
type="range"
input variant
Why a custom div is used when sliders are supported by default in HTML? The component should also support the same API as the input element (step
, max
, min
, value
).
isDiscrete={false}
variant does not trigger change events when used together withsteps
You can see it in the first example - if you remove the isDiscrete
prop, then the value is never changed.
onChange
andvalue
should serve as the main props to be consistent with all other form elements
There should be no currentValue
vs inputValue
, onChange
vs onValueChange
. It’s not clear at all.
cc @Hyperkid123
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:8 (8 by maintainers)
Top Results From Across the Web
<input type="range"> - HTML: HyperText Markup Language
elements of type range let the user specify a numeric value which must be no less than a given value, and no more...
Read more >What You Need To Know About The HTML5 Slider Element
In this short tutorial you will learn how to use it and how to emulate it in ... One of them is the...
Read more >Slider - jQuery Mobile Docs
To add a slider widget to your page, use a standard input with the type="range" attribute. The input's value is used to configure...
Read more >HTML Slider element? - javascript - Stack Overflow
I'm coding an app (temporarily up here), and I want to make its parameters modifiable. I feel the best way to do this...
Read more >HTML element: input - Vertically-oriented slider support
1 The slider can be oriented vertically by setting the non-standard -webkit-appearance: slider-vertical style on the input element. You shouldn't use this, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks @mcoker @tlabaj . Based on that, I will get this on the roadmap for our next sprint with the assumption that we will update the API, but continue with our custom approach for the HTML component.
We can certainly change the API for the slider to match the rang input.