ember-cp-validations icon indicating copy to clipboard operation
ember-cp-validations copied to clipboard

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

Open markusm7 opened this issue 5 years ago • 0 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?

markusm7 avatar May 30 '19 06:05 markusm7