Skip to content

Commit

Permalink
fix(cfb): fix min, max being invalid when empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Yelinz authored and anehx committed Dec 20, 2022
1 parent e48d7b9 commit 20a0b0c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/form-builder/addon/validations/question.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,29 +27,29 @@ export default {
validateType("IntegerQuestion", false),
and(
validateNumber({ allowBlank: true, integer: true }),
validateGtLt({ lt: "integerMaxValue" })
validateGtLt({ lt: "integerMaxValue", allowNone: true })
)
),
integerMaxValue: or(
validateType("IntegerQuestion", false),
and(
validateNumber({ allowBlank: true, integer: true }),
validateGtLt({ gt: "integerMinValue" })
validateGtLt({ gt: "integerMinValue", allowNone: true })
)
),

floatMinValue: or(
validateType("FloatQuestion", false),
and(
validateNumber({ allowBlank: true }),
validateGtLt({ lt: "floatMaxValue" })
validateGtLt({ lt: "floatMaxValue", allowNone: true })
)
),
floatMaxValue: or(
validateType("FloatQuestion", false),
and(
validateNumber({ allowBlank: true }),
validateGtLt({ gt: "floatMinValue" })
validateGtLt({ gt: "floatMinValue", allowNone: true })
)
),

Expand Down

0 comments on commit 20a0b0c

Please sign in to comment.