rangeslider.js icon indicating copy to clipboard operation
rangeslider.js copied to clipboard

programmatic value changes input null

Open ghost opened this issue 5 years ago • 2 comments

I read this https://codepen.io/andreruffert/pen/vOVygB

but After I type the input number, when deleting values from the input, is the number It automatically changes to the value of min + max / 2. I'm going to erase this whole value. I want to erase this whole value. What should I do?

ghost avatar Mar 24 '20 00:03 ghost

Having this exact same issue. Anyone know how to fix?

joshuaiz avatar Oct 01 '20 22:10 joshuaiz

$amount.on('input', function() {
  const val = this.value === "" ? 0 : this.value;
  $rangeslider.val(val).change();
});

Do something like this. check for empty value on input change and set the 0 or your default minimum value when value is empty/null/undefined etc. Or you can use if/else condition and set range slider value only when your condition match.

vijayhardaha avatar May 04 '21 10:05 vijayhardaha