question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Android] selection works incorrect and crashes in TextInput component

See original GitHub issue

React Native version:

System:
    OS: Windows 10
    CPU: (8) x64 Intel(R) Core(TM) i5-8350U CPU @ 1.70GHz
    Memory: 6.59 GB / 15.38 GB
  Binaries:
    Node: 8.11.1 - C:\Program Files\nodejs\node.EXE
    npm: 5.6.0 - C:\Program Files\nodejs\npm.CMD
    Watchman: 4.9.0 - C:\Users\Ilya_Staver\Desktop\AMIClient\watchman.EXE
  IDEs:
    Android Studio: Version  3.4.0.0 AI-183.6156.11.34.5692245

      react: 16.8.6
      react-native: 0.60.4 

Steps To Reproduce

  1. Create TextInput component on Android with onSelectionChange handler and selection prop
  2. Try to type some letters.

Describe what you expected to happen: TextInput should correct update selection

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

   onSelectionChange = ({ nativeEvent: { selection } }) => this.setState({ selection });

   <TextInput
                    ref={ref => this.inputRef = ref}
                    style={styles.messageInput}
                    maxLength={maxMessageLength}
                    multiline
                    blurOnSubmit={false}
                    onSelectionChange={this.onSelectionChange}
                    selection={this.state.selection}
                    selectionColor={blueBase}
                    onChangeText={this.onChangeText}
                    value={this.state.message}
                    autoCapitalize="none"
                    underlineColorAndroid={transparent}
                    placeholder={this.getPlaceholderMessage()}
                    placeholderTextColor={grayDarkTransparent(0.35)}
                    editable={!this.state.isVoiceRecording}
                />

untitled

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:15
  • Comments:9

github_iconTop GitHub Comments

17reactions
vforvasilecommented, Aug 23, 2019

The same bug happens in 0.60.5 related to this issue #25265

5reactions
srhtylmz19commented, Sep 8, 2019

any update?

Read more comments on GitHub >

github_iconTop Results From Across the Web

React-native TextInput crash - Stack Overflow
EDIT: Ok, so I updated npm re-installed the project and it still crashed. However, after I restarted Expo on my phone, it started...
Read more >
Multi-window support - Android Developers
Multi-window mode enables multiple apps to share the same screen simultaneously. Apps can be side by side or one above the other (split-screen...
Read more >
TextView - Android Developers
Autofill type for a selection list field, which is filled by an int representing the element index inside the list (starting at 0...
Read more >
App resources overview - Android Developers
If the qualifiers are ordered wrong, the resources are ignored. Save the respective alternative resources in this new directory.
Read more >
ANRs - Android Developers
ANRs are a problem because the app's main thread, which is responsible for updating the UI, can't process user input events or draw, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found