Commit 6713174
Add check for a ZERO value (#104)
The JS language considers the value ZERO to be
"false". This has to do with the fact that the
numeric representation of true/false are 1/0.
This was of course preventing the initial value
of a numeric field to be set to zero since there
was a check on the mounted function that saw if
the value was defined.
I've added a simple OR case, where if the value
was evaluated to FALSE than we check again for
if the value is zero. This fixed the case where
the value ZERO was not being shown when it was
deliberately chosen.
It did break another case when we pass an empty
string. To fix it I also test if the original value
is not empty (which would be evaluated to zero)
Co-authored-by: Flavio Diez <f.diez@right-basedonscience.de>1 parent d1ac034 commit 6713174
File tree
3 files changed
+14
-2
lines changed- src
- test/specs
3 files changed
+14
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
278 | | - | |
| 278 | + | |
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
| |||
377 | 377 | | |
378 | 378 | | |
379 | 379 | | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
380 | 388 | | |
381 | 389 | | |
382 | 390 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
316 | 320 | | |
0 commit comments