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

Android: auto trigger Backspace key event when numeric TextInput gets focus or blur with sogou input method. #31175

Open
StoneOfThree opened this issue Mar 17, 2021 · 3 comments

Comments

@StoneOfThree
Copy link

Description

Android mobile Phone with Android version 10, the input method is Sogou input method. The Sogou input method has two type modes: letter mode and word mode.

I use <TextInput> to create a numeric input box, switch Sogou input method's type mode to word mode. When the input box gets focus or blur, it will auto trigger Backspace key event, but i didn't type Backspace key. It is normal in letter mode.
switch input method mode

React Native version:

System:

OS: macOS 10.15.7

CPU: (12) x64 Intel(R) Core(TM) i7-8700B CPU @ 3.20GHz

Memory: 94.03 MB / 16.00 GB

Shell: 5.7.1 - /bin/zsh

Binaries:

Node: 12.4.0 - /usr/local/bin/node

Yarn: 1.16.0 - /usr/local/bin/yarn

npm: 6.9.0 - /usr/local/bin/npm

Watchman: 4.9.0 - /usr/local/bin/watchman

SDKs:

iOS SDK:

Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1

IDEs:

Android Studio: 3.6 AI-192.7142.36.36.6200805

Xcode: 11.3.1/11C505 - /usr/bin/xcodebuild

npmPackages:

react: 16.9.0 => 16.9.0

react-native: 0.61.4 => 0.61.4

npmGlobalPackages:

react-native-cli: 2.0.1

Steps To Reproduce

  1. Android mobile phone with Sogou input method, switch the input method to word mode;
  2. Use <TextInput> to create a numeric input box and use onKeyPress to monitor keyboard event;
  3. When the input box gets focus or blur, onKeyPress will get Backspace key event.

Expected Results

When Sogou input method is in word mode and the numeric input box gets focus or blur, onKeyPress shouldn't get any key event.

Snack, code example, screenshot, or link to a repository:

onKeyPress = (event) => {
    console.log('onKeyPress keyValue ====> ' + event.nativeEvent.key);
}
<TextInput
    value={value}
    maxLength={1000}
    onChangeText={value => {
        this.setState({value});
    }}
    keyboardType={'numeric'}
    onKeyPress={this.onKeyPress}
/>
@996321301
Copy link

I got the same problem

Copy link

github-actions bot commented Dec 2, 2023

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Dec 2, 2023
@vinaykumar0339
Copy link

I am also facing the same issue on the 0.72.7 version. any work around here?

@github-actions github-actions bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants