Show iOS numeric keyboard in input text

48 Views Asked by At

I need to show THIS numeric keyboard when the use focus on my input text:

iOS numeric keyboard

I have a specific requirement: separate decimals with a dot and hundreds with commas. I already have a js code to do so (separate hundreds with commas automatically as the number grows, allow a single dot input (if the input doesn't have one yet) and ignore every other key), the problem comes when I tested this on iOS, this I what I tried so far:

  • type="number": shows correct keyboard (the one above) but breaks the js, so I must use type="text" for this field.

  • type="text" and inputmode="decimal": shows this one, which only has the comma (because of a regional configuration I think, but I will always need the dot, no matters the configuration of the device, that's why the first one will be the best option)

iOS wrong numeric keyboard

  • type="text" and inputmode="numeric": number only, even worse

iOS numbers only keyboard

  • type="text" and a pattern: same result as before

So I'm lost right now and I'm not sure there is a solution for this, but well, hope you can help me, thank you!

0

There are 0 best solutions below