|
var numeric = /^[0-9]*\.?[0-9]*?$/.test(newVal); |
A Number can also be a negative which starts with a dash. The regex fails to accept this sort of numbers. The same field shows a slider on the right. One can that slider to get to negative numbers and that is fine and passes validation since no keypress was done.
Any suggestion on how to get around it?
backbone-forms/src/editors/number.js
Line 52 in 7aad9e3
A Number can also be a negative which starts with a dash. The regex fails to accept this sort of numbers. The same field shows a slider on the right. One can that slider to get to negative numbers and that is fine and passes validation since no keypress was done.
Any suggestion on how to get around it?