I've some issues with decimal input on iOS using the numeric keypad. I have the following HTML:
$('#number').keyup(function() {
$('#log').prepend('<p>Input: ' + $(this).val() + '</p>');
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<input type="number" inputmode="decimal" id="number">
<p>
Input as number:
<div id="log"></div>
</p>
This is working as expected in Chrome browser, Android etc., but on iOS there is some issues. If I set the Region to e.g. Denmark (comma decimal seperator) but the Language to English (UK) (point decimal seperator), the number pad gives me a comma decimal seperator, but I seems that the HTML/JS does not support this. If I input e.g. 12,3
the value of the input field becomes empty when I use the comma.
How can I fix this?
When Region is Denmark and Language is Danish, it's all working as expected.
The code and demo is available on this StackBlitz: https://decimal-input-ios.stackblitz.io