Earlier quoted context omitted.
> dependent on the slider values That’s the tricky part for a JS free implementation, right? Or am I missing something?
I think they are suggesting using something like this, which does work to target certain attributes: input[value="5"] { width: 20%; } This could then be combined with the sibling selector to target the other one input[value="5"] + input[value="11"] { width: 80%; } Though I am unsure how to make it entirely workable (you probably need a simple event listener to set the DOM node value to the dynamic form value). Intere…
Native dual-range input
41–50 of 51 posts
Re: Native dual-range input
#42Re: Native dual-range input
#43Re: Native dual-range input
#44Is this the right place to report bugs? The handles in the first two examples trap touch interaction blocking scroll. The latter three examples don't. This has a side effect of not being able to 'drag up to reveal the labels underneath ones fingers since it just scrolls the page, keeping the labels underway the finger.
Which browser and OS are you using? Because this library doesn't do anything regarding the scroll blocking (because it is using native inputs). On my phone (iOS) scroll is blocked on all input[type=range] elements, styled or not.
Re: Native dual-range input
#45Earlier quoted context omitted.
I think they are suggesting using something like this, which does work to target certain attributes: input[value="5"] { width: 20%; } This could then be combined with the sibling selector to target the other one input[value="5"] + input[value="11"] { width: 80%; } Though I am unsure how to make it entirely workable (you probably need a simple event listener to set the DOM node value to the dynamic form value). Intere…
I think it can be theoretically done, like it is mentioned in the comment above, but you would need a new block of CSS for every slider min/max/step combination. It feels it would be harder to maintain than the javascript version.
Re: Native dual-range input
#46> The "native" part is somewhat open for discussion. I call it native because the library uses two native HTML range inputs. This means that all of the native interactions and accessibility features are preserved. My dividing line is: if it needs Javascript to work as intended, it's not native anymore.
There are also native, vanilla JavaScript methods for things like form validation that I would consider distinct from a library that doesn't use the browser's internal validation tooling at all.
Re: Native dual-range input
#47Very clever! Totally unrelated to this project, just a general UI question: does anyone like these inputs? Every time there is a number input next to one, I use that instead. Seems the upper limit of “ticks” you can have on one before it becomes unusable is like… 10? Proper number inputs support all the same features (min, max, arrow keys to increment/decrement), but you can also just input an exact number. The range…
I implemented one in https://ossia.io but in practice a draggable spinbox is much more useable
Re: Native dual-range input
#48Earlier quoted context omitted.
I think they are suggesting using something like this, which does work to target certain attributes: input[value="5"] { width: 20%; } This could then be combined with the sibling selector to target the other one input[value="5"] + input[value="11"] { width: 80%; } Though I am unsure how to make it entirely workable (you probably need a simple event listener to set the DOM node value to the dynamic form value). Intere…
I think it can be theoretically done, like it is mentioned in the comment above, but you would need a new block of CSS for every slider min/max/step combination. It feels it would be harder to maintain than the javascript version.
But that still feels like asking for trouble:)
Luckily I need to leave the house now, I'm feeling CSS naughty.
* IIRC support for anything besides `content:` is still very unstable.
Re: Native dual-range input
#49This is cool! I have always thought that the HTML input needed a dual-value implementation because that makes a lot of sense. Consider the use case "I want to filter products with at least X widgets but no more than Y". However, I found a bug in Firefox I want to highlight: Any time I click on a min or max handle they change change the value one step up or down. If I make an effort to click in the dead center of the…
Re: Native dual-range input
#50Playing around with this and immediately hit a bug. If I drag the sliders to 100 - 100 and then try to do 99 - 99, I can't. I can't get there from 99 - 100, and I can't get there from 98 - 99. The only way to get to 99 - 99 is to drag the lower bound somewhere lower than 98. If I'm at 98 - 99 and I drag it down to 97 - 99, then I can get to 99 - 99. This bug can occur anywhere, it was just easiest to hit at 99 - 99 b…
Nice catch! Actually I thought of this and it works in Chrome and Firefox, but it seems that Safari is not triggering the focus event on mouse down, but only when you start moving the slider. Thank you for the report, I'll make sure to fix it.