Merge pull request #2213 from SergioCrisostomo/fix-number-input

prevent firing change when typing numbers < min
This commit is contained in:
Aresn 2017-10-27 02:22:16 -05:00 committed by GitHub
commit 7a9f6b28fc

View file

@ -263,6 +263,7 @@
if (!isNaN(val) && !isEmptyString) { if (!isNaN(val) && !isEmptyString) {
this.currentValue = val; this.currentValue = val;
if (event.type == 'input' && val < min) return; // prevent fire early in case user is typing a bigger number. Change will handle this otherwise.
if (val > max) { if (val > max) {
this.setValue(max); this.setValue(max);
} else if (val < min) { } else if (val < min) {