Closed wendevlin closed 7 years ago
Hi @masterwendu! I agree that the error message is not very helpful. A decimal amount should work though. I will look into it!
The problem is that Firefox triggers the onChange handler only on blur
whereas Chrome triggers it on every keystroke. This only happens for input fields of type number
.
Therefore our input-validator, which is bound to the onChange event, is not triggered in Firefox. Unfortunately, there is no consistent support across mobile browsers for other events like onKeyPress, onKeyDown or onKeyUp. Those events would allow a different implementation in which we cancel the original event and only pass through the pressed key if it is valid (i.e. numbers or dots).
I haven't found a solution yet, that works across all browsers and delivers a good user experience.
Oh ok,
Then I would trigger input-validator
onBlur
and on save of the bill.
Or is this a issue?
The whole idea of the validator was to provide assistance to the user as they type so that they can never enter an invalid amount. So triggering the validator onBlur
doesn't really help.
It is not possible to add a bill with a comma separated amount like (2,30 €). Tested with Firefox Mobile. You should also allow such inputs and parse it on saving. Moreover is the error message not very useful.