Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with keyboard in mobile #189

Open
nataliazanolli opened this issue Jun 7, 2018 · 12 comments
Open

Problems with keyboard in mobile #189

nataliazanolli opened this issue Jun 7, 2018 · 12 comments

Comments

@nataliazanolli
Copy link

When send the props fixedDecimalScale, or prefix={'$'}, like has one example in demo, the keyboard in mobile has problem.

Select the input to open keyboard, change the keyboard mode to select numbers, when put the first number in input, the keyboard mode returns to letters.

It's like if when change the text of value internally the keyboard mode changes.

@nataliazanolli
Copy link
Author

So, I put the type='tel', but in iOS mobile no has the ',' and the '.' to digit decimal numbers, then i'm back to type text.

What I did to solve my problem, is ugly but work for me: In onFocus I change the state to render without props fixedDecimalScale and thousandSeparator, and in onBlur I change the state again to render with theese two props.

Two problems I solve this way:

  1. Mobile keyboard to not change the mode after users select number mode;
  2. When users digit too fast that select input goes to final and don't allow the users digit more without click in right position to permit digit more.

@mosijava
Copy link

mosijava commented Jan 6, 2019

it would be more convenient if it support input type="number". changing keyboard in mobile to numbers are actually annoying when the input should get numbers only.
I hope they fix it

@resobyte
Copy link

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

I used this code.

Android device screenshot:
Screen Shot 2019-03-13 at 11 02 33

IOS device screenshot:
Screen Shot 2019-03-13 at 11 14 28

If we can find a way to bring "," to the ios keyboard, the problem will be solved

Android is correct, but iOS not display "," comma..

Can you help me?

@marknguyen85
Copy link

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

I used this code.

Android device screenshot:
Screen Shot 2019-03-13 at 11 02 33

IOS device screenshot:
Screen Shot 2019-03-13 at 11 14 28

If we can find a way to bring "," to the ios keyboard, the problem will be solved

Android is correct, but iOS not display "," comma..

Can you help me?

same with you.

@mosijava
Copy link

mosijava commented Apr 6, 2019

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

I used this code.

here you can see unfortunately Firefox doesn't support "inputmode" attribute.

s-yadav added a commit that referenced this issue Feb 20, 2020
- Fix type declaration. Added allowLeadingZeros on types. #385
- Fixed #386. Clear the input on blur if ony `-` is added.
- Added prop-type defination for RefObject #384
- Added inputMode = numeric by default so in mobile browser proper keyboard should open. #189, #312
s-yadav added a commit that referenced this issue Feb 20, 2020
- Fix type declaration. Added allowLeadingZeros on types. #385
- Fixed #386. Clear the input on blur if ony `-` is added.
- Added prop-type defination for RefObject #384
- Added inputMode = numeric by default so in mobile browser proper keyboard should open. #189, #312
@dccarmo
Copy link

dccarmo commented May 2, 2020

@s-yadav I think this commit (1ade39f) broke the functionality being discussed here: the iOS keyboard show up with the numeric keyboard that doesn't have the decimal point/comma key and there's no way to override it.

@s-yadav
Copy link
Owner

s-yadav commented May 3, 2020

@dccarmo I will check this. This does says it will show correct input on inputmode="numeric"
https://css-tricks.com/everything-you-ever-wanted-to-know-about-inputmode/

In meanwhile you can still override it using.

<NumberFormat inputMode="decimal" />

or remove it using

<NumberFormat inputMode={false} />

@s-yadav
Copy link
Owner

s-yadav commented May 3, 2020

@dccarmo Can you also share device and OS information.

@dccarmo
Copy link

dccarmo commented May 3, 2020

@s-yadav That's great, I didn't know we could override it.

I'm testing on an iPhone XS Max on iOS 13.4.1.

@s-yadav
Copy link
Owner

s-yadav commented May 4, 2020

@dccarmo The latest release removes inputmode on IOS device when decimals, minus characters are required.

@dccarmo
Copy link

dccarmo commented May 17, 2020

@s-yadav Awesome, thank you! I think this issue can probably be closed (@nataliazanolli).

@Grawl
Copy link

Grawl commented Jun 15, 2021

@s-yadav

or remove it using

<NumberFormat inputMode={false} />

Type mismatch:

inputMode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';

(from `node_modules/@types/react/index.d.ts)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants