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

InputNumber: Cannot insert value on Android #6275

Closed
nankoviliya opened this issue Apr 1, 2024 · 15 comments · Fixed by #6332
Closed

InputNumber: Cannot insert value on Android #6275

nankoviliya opened this issue Apr 1, 2024 · 15 comments · Fixed by #6332
Assignees
Labels
Device: Mobile Issue or pull request is *only* related to Mobile device
Milestone

Comments

@nankoviliya
Copy link

Describe the bug

Describe the bug

I'm trying to insert value into the InputNumber component on https://primereact.org/inputnumber/ using my Android device, but the input doesn't accepted. Please, watch screen record below.

Tried this on Iphone 11, Safari, Firefox, cannot reproduce the issue.

Screen Recorded : https://github.com/primefaces/primereact/assets/63155421/c3e4434a-be16-4f39-bd24-4e2b0bcd13f9

Device: Redmi 7; Android 10

Reproducer

No response

PrimeReact version

10.6.2

React version

17.x

Language

TypeScript

Build / Runtime

Create React App (CRA)

Browser(s)

Chrome 123.0.6312.80

Steps to reproduce the behavior

No response

Expected behavior

Input accepted

@nankoviliya nankoviliya added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Apr 1, 2024
@nankoviliya
Copy link
Author

The issue is presented in MI Browser too.

@melloware
Copy link
Member

@ilis08 can you go here and type the number 5 on your Android and show the results:

https://w3c.github.io/uievents/tools/key-event-viewer.html

For example in Windows when I press 5 this is what it looks like

image

@nankoviliya

This comment was marked as outdated.

@nankoviliya

This comment was marked as outdated.

@melloware
Copy link
Member

melloware commented Apr 1, 2024

OK yeah its an Android problem . See that your keycode is 229 and unidentified. Not sure what version of Android you are using but that looks like a bug. The number 5 should register as Digit5 and keycode 52 not generic 229. I bet all your numbers are showing up as 229. Android is a mess like this...

@melloware

This comment was marked as outdated.

@virgil31
Copy link

virgil31 commented Apr 4, 2024

Yeah we have the same problem at work. I personally can confirm this same issue using:

*Device: Redmi Note 10 Pro
*OS: Miui 14.0.9 Global
*Android version: 13
*Browser tested: Chrome, Brave

Of course I experience the very same problem both on our fresh Vite-started project and the PrimeReact components'showcase/demo.

@melloware melloware added Device: Mobile Issue or pull request is *only* related to Mobile device and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Apr 4, 2024
@virgil31
Copy link

virgil31 commented Apr 5, 2024

I want to add that switching to the "9.6.5-SNAPSHOT" version in the component showcase (https://v9.primereact.org/inputnumber/) make the problem go away and it is working as intended on my mobile device (see previous comment for infos).

@melloware

This comment was marked as outdated.

@melloware
Copy link
Member

melloware commented Apr 5, 2024

Android is a total mess see: https://stackoverflow.com/questions/36753548/keycode-on-android-is-always-229

Only device/browser that doesn't properly implement onKeyDown and onKeyUp. cc @FlipWarthog

Did a bit research for this one, seems it's an Android chrome browser issue. The keyup and keydown events always return key code 229 as a composition that buffers the user’s keystrokes.

This has great info: https://javascript.info/keyboard-events#mobile-keyboards

Here are some discussion but no solution presented:

facebook/react#6176

http://stackoverflow.com/questions/30743490/capture-keys-typed-on-android-virtual-keyboard-using-javascript

https://bugs.chromium.org/p/chromium/issues/detail?id=118639#c259

melloware added a commit to melloware/primereact that referenced this issue Apr 8, 2024
melloware added a commit to melloware/primereact that referenced this issue Apr 8, 2024
gucal added a commit that referenced this issue Apr 9, 2024
Fix #6275: InputNumber restore Android usage
@gucal gucal added this to the 10.6.3 milestone Apr 9, 2024
@melloware
Copy link
Member

10.6.3 is released can you try again @ilis08 @virgil31

@melloware melloware self-assigned this Apr 9, 2024
@virgil31
Copy link

virgil31 commented Apr 9, 2024

10.6.3 is released can you try again @ilis08 @virgil31

It works!
Both our fresh Vite-started project and the PrimeReact components'showcase/demo are ok.
Multiple Android devices tested (Xiaomi, Redmi, Samsung).

Thanks for your time and feedback @melloware !

@melloware
Copy link
Member

@virgil31 thanks to @FlipWarthog for lending me an Android device!

@FlipWarthog
Copy link
Contributor

@melloware all this complaining about Android I had to get you in front of one. It was a fun puzzle

@nankoviliya
Copy link
Author

10.6.3 is released can you try again @ilis08 @virgil31

It works! Both our fresh Vite-started project and the PrimeReact components'showcase/demo are ok. Multiple Android devices tested (Xiaomi, Redmi, Samsung).

Thanks for your time and feedback @melloware !

Yep, I can confirm it works on my Redmi 7. Thanks @melloware , great job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Device: Mobile Issue or pull request is *only* related to Mobile device
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants