Skip to content

Android IME keyboards not working with DatePicker/RangePicker due to keydown handling #929

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

Open
jfernandezpe opened this issue May 19, 2025 · 0 comments

Comments

@jfernandezpe
Copy link

Hi there,

I'm using Antd Date Picker and Range Picker, and I'm facing an issue: I can't use virtual keyboards (Input Method Editors or IMEs) on my Android device because the browser is not passing the actual pressed key to JavaScript. If you listen to the native HTML keydown event, the event.key is Unidentified.

This article describes a similar issue quite well: https://weiyen.net/articles/an-unusual-google-keyboard-bug/. However, I've been researching a bit more and it seems to be related to several virtual keyboards, including GBoard and Microsoft SwiftKey.

I found some issues in Chromium, but unfortunately, it looks like they don't plan to fix this, since it rely on how virtual keyboards work for getting that info:

A possible workaround seems to be handling validation and formatting by listening to the input event instead of keydown. So the problem might be in the function onFormatKeyDown, which could still handle special keys like Enter, Escape, etc., and move validation and committing changes to a new input handler.

What do you think about it?

Best regards,
Jose

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

1 participant