dashjoin / json-schema-form

Angular JSON Schema Form Library
https://dashjoin.github.io/
Apache License 2.0
84 stars 27 forks source link

validation issue for numbers #144

Closed fariz-huseynov closed 1 year ago

fariz-huseynov commented 2 years ago

the following code block doesn't work.

if (this.schema.minimum) {  
        if (!(Number(this.value) >= this.schema.minimum)) {
          return this.e('Must greater than or equal ' + this.schema.minimum);
        }
}
aeberhart commented 2 years ago

If you visit https://dashjoin.github.io/#/example/maximum and change "maximum" to "minimum" it works fine. Can you list your steps to reproduce?

fariz-huseynov commented 2 years ago

still doesn't work for 0 image

aeberhart commented 2 years ago

ok - you're right if (this.schema.minimum) evaluates to false if minimum is zero!