I am creating an simple on screen keyboard (osk) and I need to be able to update the the value of an input type number element with a decimal. When I try to add a ‘.’ to a number field, I receive a warning ‘The specified value “.” is not a valid number’. This is of course because it is being recognized as a string. However, when using the hardware keyboard on my laptop the decimal is inserted without issue. What must be done to insert the ‘.’ when using the osk to type in a float value?
My relevant code for updating the value is basically:
event.target.value = (event.target.value + ‘.’)