Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

programmatic value changes input null #348

Open
ghost opened this issue Mar 24, 2020 · 2 comments
Open

programmatic value changes input null #348

ghost opened this issue Mar 24, 2020 · 2 comments

Comments

@ghost
Copy link

ghost commented Mar 24, 2020

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?

@joshuaiz
Copy link

joshuaiz commented Oct 1, 2020

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

@vijayhardaha
Copy link

$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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants