Skip to content

Commit bf29b88

Browse files
authored
Merge pull request #190 from ditdot-dev/fix/min-max-number
Add min/max validation to Number type question
2 parents e94a056 + 03da153 commit bf29b88

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/components/QuestionTypes/NumberType.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@
2121
2222
methods: {
2323
validate() {
24+
if (!isNaN(this.question.min) && this.dataValue < this.question.min) {
25+
return false
26+
}
27+
28+
if (!isNaN(this.question.max) && this.dataValue > this.question.max) {
29+
return false
30+
}
31+
2432
if (this.hasValue) {
2533
if (this.question.mask) {
2634
return this.validateMask()

0 commit comments

Comments
 (0)