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] TextInput | Can't select text #22610

Closed
1 task
mattveraldi opened this issue Dec 12, 2018 · 3 comments
Closed
1 task

[Android] TextInput | Can't select text #22610

mattveraldi opened this issue Dec 12, 2018 · 3 comments
Labels
Component: Text Component: TextInput Related to the TextInput component. Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.

Comments

@mattveraldi
Copy link

Environment

OS: Windows 10
Node: 8.12.0
Yarn: Not Found
npm: 6.4.1
Watchman: Not Found
Xcode: N/A
Android Studio: Version 3.2.0.0 AI-181.5540.7.32.5056338

Packages: (wanted => installed)
react: 16.0.0 => 16.0.0
react-native: 0.50.3 => 0.50.3

Description

My app has got three navigation screens (implemented with react-router), and it has a textInput on the first and the third one.
On the first screen I CANNOT select text, on the third one I can.
It only works if I focus on the textInput and I switch from potrait to landscape and come back to potrait again, it's very strange.
I tried every thing that came across my mind, I read the issue #9958 but nothing on that helped me.
I really need my users to select text in order to copy/paste.. but I don't know how to fix that problem.

Reproducible Demo

Honestly I don't know how to reproduce this bug. I leave some code here of the first screen.

 <View style={styles.inputSave}>
        <TextInput style={styles.textInput}
                          onLayout = {(event) => this.setState({"inputHeight": event.nativeEvent.layout.height})} 
                          underlineColorAndroid='rgba(0,0,0,0)'  placeholder={this.props.reduxState.mainScreenReducer.lang.insertChords} 
                          onChangeText={(event)=> { this.handleReset(event); this.props.setInputRef(event)}} 
                          onEndEditing = {(e)=> this.props.setOutput(e.nativeEvent.text.replace(/\n/g, " \n "))} 
                          defaultValue={this.handleDefaultValue(mainScreenReducer.inputRef) } 
                          multiline = {true}/>
        <SAVEbutton onPress={()=>{this.handleNameSongInput()}} 
                              style={{aspectRatio:1, height:50}} 
                              textColor={this.state.modal}/>
      </View>

styles.js:

  textInput:{
    flex:1,
    borderWidth:1.3,
    borderColor:"black",
    borderRadius:5,
    backgroundColor:"white"
  },
  inputSave:{
    flexDirection:"row",
    width:"80%",
  },

A gif that shows the bug:
At first I tried to select text in potrait mode, and I couldn't. Then I switched to landscape and I could, then to potrait and it all worked fine but every time I reload the app the bug comes back.

issuevideo

@react-native-bot react-native-bot added 🔶Components Component: Text Component: TextInput Related to the TextInput component. Platform: Android Android applications. labels Dec 12, 2018
@react-native-bot
Copy link
Collaborator

It looks like you are using an older version of React Native. Please update to the latest release, v0.57 and verify if the issue still exists.

The "⏪Old Version" label will be removed automatically once you edit your original post with the results of running react-native info on a project using the latest release.

@jamsch
Copy link
Contributor

jamsch commented Dec 12, 2018

Related, and a current workaround: #20887

@mattveraldi
Copy link
Author

Related, and a current workaround: #20887

Thank you a lot jamsch, it finally works!

@facebook facebook locked as resolved and limited conversation to collaborators Dec 12, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Dec 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Component: Text Component: TextInput Related to the TextInput component. Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

3 participants