Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants