adopted-ember-addons / ember-cp-validations

Ember computed property based validations

Home Page:https://adopted-ember-addons.github.io/ember-cp-validations/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`number`-Validator: `null`-Value validates differently for different number-ranges

markusm7 opened this issue · comments

Environment

  • Ember Version: 3.8.0
  • Ember CLI Version: 3.8.1
  • Ember CP Validations Version: 3.5.5

Steps to Reproduce

Implement number-validator with options:

{
  allowString: true,
  integer: true,
  // allowNone: false,
  gte: -1,
  lte: 10
}

null or undefined validate this to true (because of allowNone defaults to true)
Positive number ranges like from 1 to 10 wont behave like that. Why is this the case?
Either allowNone works for every number range or it does never if there is a range provided.

Or am i missing something?