React-native: [Android] selection works incorrect and crashes in TextInput component

Created on 13 Aug 2019  路  9Comments  路  Source: facebook/react-native

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

Bug TextInput Android Stale

Most helpful comment

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

All 9 comments

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

any update?

Issue still reproduced in React Native 0.61.2

Someone made a pull request #26680

same issue in 0.61.2

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

Still reproduced in 0.61.5

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

Was this page helpful?
0 / 5 - 0 ratings