Skip to content

Commit 9887e46

Browse files
committed
Improve NumberType min/max validation
1 parent d5b4146 commit 9887e46

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/QuestionTypes/NumberType.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
2222
methods: {
2323
validate() {
24-
if (!isNaN(this.question.min) && this.dataValue < this.question.min) {
24+
if (this.question.min !== null && !isNaN(this.question.min) && +this.dataValue < +this.question.min) {
2525
return false
2626
}
2727
28-
if (!isNaN(this.question.max) && this.dataValue > this.question.max) {
28+
if (this.question.max !== null && !isNaN(this.question.max) && +this.dataValue > +this.question.max) {
2929
return false
3030
}
3131

0 commit comments

Comments
 (0)