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

TextInput not working as expected when programatically entering text #13112

Closed
ted-ks opened this issue Mar 23, 2017 · 1 comment
Closed

TextInput not working as expected when programatically entering text #13112

ted-ks opened this issue Mar 23, 2017 · 1 comment
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@ted-ks
Copy link

ted-ks commented Mar 23, 2017

The below code does not work properly in iOS (iPhone 6). When I press ‘Push Me’, the word is not displayed completely and the cursor is also not shown. On further investigation, I found out that onChangeText and onContentSize change are not triggered. Pressing any key on the key board after pressing the ‘Push Me’ button displays the full word. I want the full word to be displayed when the button is clicked. It works, if I use value prop to update the TextInput. But I need to display formatted text like in the ‘TokenizedTextExample’ in this link: https://facebook.github.io/react-native/docs/textinput.html

"react-native": "0.41.2"
"react": "15.4.2"

import React, { Component } from 'react';
import {
  AppRegistry,
  TouchableOpacity,
  TextInput,
  Text,
  View
} from 'react-native';

export default class keypost extends Component {
  constructor(props) {
    super(props);
    this.state = {
      part: '',
      update: true
    };
  }


  myfunc() {
    this.setState({ part: <Text><Text style={{ color: 'blue' }}>"thi sgs g _is_good_boyo lllllll COurs uad is sfd_sdf llllsdf sfsddfadfadsfadsff dsafdfas"</Text> <Text>"fasdfa sjsjsjs jsjsjsj sjsjshshshsshshss"</Text></Text> })
  }
  render() {
    var parts = this.state.part
    return (
      <View style={{ paddingTop: 50 }}>
        <TextInput
          multiline={true}
          style={{ height: 300 }}
          >
          <Text>{parts}</Text>
        </TextInput>
        <TouchableOpacity style={{ height: 100, width: 100 }} onPress={this.myfunc.bind(this)} >
          <Text style={{}}>
            Push Me
            </Text>
        </TouchableOpacity>
      </View>
    );
  }

}
@hramos
Copy link
Contributor

hramos commented May 25, 2017

We're cutting down on the number of outstanding issues, in order to allow us to focus. I'm closing this issue because it has been open for over 60 days with no activity. If you think it should still be opened let us know why.

@hramos hramos closed this as completed May 25, 2017
@hramos hramos added the Icebox label May 26, 2017
@facebook facebook locked as resolved and limited conversation to collaborators May 29, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

3 participants