@openmrs/ngx-formentry 3.1.2-pre.183 → 3.1.2-pre.186

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2267,7 +2267,11 @@
2267
2267
  if (control.hidden) {
2268
2268
  return null;
2269
2269
  }
2270
- if (control.value && control.value.length !== 0) {
2270
+ // Case 1: control.value is a number
2271
+ // all the numbers should be passed for validation
2272
+ // Case 2: control.value is not a number:
2273
+ // if its empty string or null or undefined it will return false else it will pass through for validation
2274
+ if (typeof control.value === 'number' || control.value) {
2271
2275
  var v = control.value;
2272
2276
  return v >= min
2273
2277
  ? null
@@ -2287,7 +2291,11 @@
2287
2291
  if (control.hidden) {
2288
2292
  return null;
2289
2293
  }
2290
- if (control.value && control.value.length !== 0) {
2294
+ // Case 1: control.value is a number
2295
+ // all the numbers should be passed for validation
2296
+ // Case 2: control.value is not a number:
2297
+ // if its empty string or null or undefined it will return false else it will pass through for validation
2298
+ if (typeof control.value === 'number' || control.value) {
2291
2299
  var v = control.value;
2292
2300
  return v <= max
2293
2301
  ? null