Description
Is this a bug report?
Yes.
Have you read the Contributing Guidelines?
Yes.
Environment
Environment:
OS: macOS High Sierra 10.13.3
Node: 9.4.0
Yarn: 1.0.2
npm: 5.6.0
Watchman: 4.9.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 3.0 AI-171.4443003
Packages: (wanted => installed)
react: ^16.2.0 => 16.2.0
react-native: 0.53.0 => 0.53.0
Tested on Devices:
- Plus One Japan Limited FTJ161B (Android 6.0, API 23)
- Samsung Galaxy Note 8 (Android 7.1.1)
Steps to Reproduce
Using com.justsystems.atokmobile.tv.service
custom keyboard then typing into a <TextInput secureTextEntry={true}>
field yields the following crash:
13:16:19.098 4410-4410/com.example.dev E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.dev, PID: 4410
java.lang.IndexOutOfBoundsException: charAt: -1 < 0
at android.text.SpannableStringBuilder.charAt(SpannableStringBuilder.java:122)
at com.facebook.react.views.textinput.ReactEditTextInputConnectionWrapper.setComposingText(ReactEditTextInputConnectionWrapper.java:104)
at com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:340)
at com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage(IInputConnectionWrapper.java:78)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5728)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)
- Focus the
<TextInput>
- On the soft keyboard, hitting the "1" key and the "backspace" key in alternation seems to cause the crash although it seems random.
Issue isn't present with the Google AOSP keyboard. Seems to happen only with this keyboard and the secureTextEntry={true}
.
Expected Behavior
This should work on all keyboards.