question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Slider - use standard input element

See original GitHub issue

I found several issues with the Slider component.

  1. 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).

  1. isDiscrete={false} variant does not trigger change events when used together with steps

You can see it in the first example - if you remove the isDiscrete prop, then the value is never changed.

  1. onChange and value 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:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
mcarranocommented, Feb 24, 2021

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.

0reactions
tlabajcommented, Feb 24, 2021

We can certainly change the API for the slider to match the rang input.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found