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 Bug - React Native ^0.54 #18844

Closed
myrsapp opened this issue Apr 13, 2018 · 14 comments
Closed

TextInput Bug - React Native ^0.54 #18844

myrsapp opened this issue Apr 13, 2018 · 14 comments
Labels
Component: TextInput Related to the TextInput component. Resolution: Locked This issue was locked by the bot.

Comments

@myrsapp
Copy link

myrsapp commented Apr 13, 2018

Environment:
OS: macOS Sierra 10.12.6
Node: 8.9.4
Yarn: 0.24.6
npm: 5.6.0
Watchman: 4.9.0
Xcode: Xcode 9.3 Build version 9E145

Packages: (wanted => installed)
react: ^16.3.0-alpha.1
react-native: ^0.54.4

I am using code example from https://facebook.github.io/react-native/docs/textinput.html, but I change value to "HARD CODE". If I try on the website, I cannot change the value. However, if i make one on my project, i can change the value.

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

export default class UselessTextInput extends Component {
  constructor(props) {
    super(props);
    this.state = { text: 'Useless Placeholder' };
  }

  render() {
    return (
      <TextInput
        style={{height: 40, borderColor: 'gray', borderWidth: 1}}
        onChangeText={(text) => this.setState({text})}
        value={"HARD CODE"}
      />
    );
  }
}
@react-native-bot react-native-bot added the Component: TextInput Related to the TextInput component. label Apr 13, 2018
@reynaldlee
Copy link

Same Problem.

<TextInput onChangeText={(text) => this.setState({text: "Hello"})} value={this.state.text} ></TextInput>

The TextInput value should always be "Hello", but it doesn't.

React-native version:
react: 16.3.1
react-native: 0.55.2

@jerameel
Copy link

Also facing the same issue on iOS. I had a validation with textInput and it changes the value state, but on iOS the value property is being overriden by the original(should be the validated value from state) value. It works fine on Android though.

@Sanglepp
Copy link

Linking the issue that @jerameel has created on same topic #18874

@chefkefu
Copy link

This doesn't seem to be a problem in version 0.51 and older but got regressed in the newer version of react native.

<TextInput onChangeText={(text) => this.setState({text: "Hello"})} value={this.state.text} >

@bhrott
Copy link

bhrott commented Apr 22, 2018

Same here.

@zaguiini
Copy link

Any fixes?

@Fconstant
Copy link

Same. This also affects react-native-masked-text

@GregorHorvatH
Copy link

Same Problem.
react-native: 0.55.4

@vovkasm
Copy link
Contributor

vovkasm commented May 22, 2018

#18874

@jackmew
Copy link

jackmew commented Jun 18, 2018

No Problem:
0.51.0 React 16.0.0 (Original for my project)
0.53.0 React 16.2.0

Cause Problem:
0.54.0 React 16.3.0-alpha.1(Context API), A lot of under-the-covers work on Yoga, iOS's Text and TextInput
0.55.0
0.55.2
0.55.3
0.55.4

@garfieldnate
Copy link

Probably being solved in this PR: #18278. There are many separate bug reports for the same bug in TextInput.

@Balasnest
Copy link

Faced same problem in 0.55.4 What is the stable version for this fix? Should we go for 0.56 ?

@liamse
Copy link

liamse commented Sep 30, 2018

I got the same problem in 0.56.0 but in 0.57.0 it is solved.

@kelset
Copy link
Contributor

kelset commented Dec 17, 2018

Given the inactivity and that latest comments say that is fixed on 0.57 I'm going to close this.

Please open a new issue following the template if needed.

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

No branches or pull requests