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.

Should we have range value beside input[type=range] ?

See original GitHub issue

I just added input[type=range] support, here’s the example: https://sweetalert2.github.io/#input-range

My question is to collaborators and other UI specialists: should we have by default <output> tag with current range value? As you probably know, the native behaviour for input[type=range] is to show slider only, without value:

As to me it would be nice for plugin users to have something like this by default:

I think, in most cases, it’s useful to see the current value.

Thoughts?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
gvernicommented, Jun 17, 2019

It feels wrong to convert output into input

I completely agree with you. Another way of looking at it though, is to consider range + output as single composite input element: in this case both elements should be able to change the value of the control. I feel this is extremely useful to give a fine grained control on small screen devices. But at the end of the day this has nothing to do (strictly) with Sweetalert2, and more to do with the range input (see my next comment as well)

I believe we shouldn’t add the additional complexity to the codebase becase the use-case is quite rare

This is a very good point. So even though I consider that useful, I agree we should not complicate the code base.

Here’s the solution of input[type=range] + input[type=number]:

I like that @limonte. I’ll add it to the sweetalert2-examples repo. As I said above, it may be useful for those that choose to have a range that should work (with fine grained values) on small screen as well.

0reactions
ledzgiocommented, Jun 21, 2019

Here’s the solution of input[type=range] + input[type=number]:

The solution is quite straightforward, but I believe we shouldn’t add the additional complexity to the codebase becase the use-case is quite rare.

This works perfectly for what I need to do. Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTML5 input type range show range value - Stack Overflow
I have integrated it fully and works fine. But I would like to use a textbox to show the current slide value. I...
Read more >
HTML 5|input type range|slider
If we have: <input type="range" min="0" max="1000">. It looks like this and it is difficult to get a precise value. 0 1000. So...
Read more >
Value Bubbles for Range Inputs | CSS-Tricks
The trick is positioning the bubble along the range input so it slides alongside the “thumb”. To do that, we'll need to calculate...
Read more >
<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 >
How to use the HTML5 range input type | HTML Form Guide
Creating anything close to the sliding range element takes tons of lines of ... We can have the birth year as a sliding...
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