Search code examples
androidiosreactjskeyboard

Show Decimal Keyboard in ReactJS for iOS


My application is ReactJS. I am using WKWebview on iOS. I am using number format react-number-format for input.

This component not supported(type="number"). You can use only "text,tel,password" type.

<input type="number" pattern="[0-9]*"/> I can't use this.

So, I wrote the following code.

<NumberFormat id="numberFormat" decimalSeparator="," thousandSeparator="." inputMode="decimal" pattern="[0-9]*" .../>

Android device screenshot:

Android device keyboard screenshot

Its correct for me.

IOS device screenshot:

iOS device keyboard screenshot

Its wrong for me.

I want to see ",(comma)" on the keyboard(decimal pad)

Kindly review and give feedback.


Solution

  • I solved my problem by adding the following line of code.

    <NumberFormat id="numberFormat" decimalSeparator="," thousandSeparator="." inputMode="decimal" pattern="[0-9],*" .../>
    

    But IOS Safari supporting version 12.2 or higher on inputMode="decimal" .

    Thanks.