rangeslider.js
rangeslider.js copied to clipboard
programmatic value changes input null
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?
Having this exact same issue. Anyone know how to fix?
$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.