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

on iOS TextInput native value is not matching provided value prop #19167

Closed
3 tasks done
mydesweb opened this issue May 7, 2018 · 5 comments
Closed
3 tasks done

on iOS TextInput native value is not matching provided value prop #19167

mydesweb opened this issue May 7, 2018 · 5 comments
Labels
Component: TextInput Related to the TextInput component. Platform: iOS iOS applications. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@mydesweb
Copy link

mydesweb commented May 7, 2018

on iOS TextInput native value is not matching provided value prop, on Android is working as expected

basically there is no way to manipulate / filter / replace what the user is typing in a TextInput on iOS, the TextInput is ignoring provided value prop or probably TextInput is not re-rendered accordingly, hope you can fix it - it is quite important

Steps to Reproduce

class ControlledInput extends React.Component {
  onChangeText = (text) => {
    this.setState({ inputValue: 'this text should always suppress user typed text but will not work on iOS' })
  }
  render() {
    const { inputValue } = this.state
    return (
      <TextInput
         onChangeText={this.onChangeText}
         value={inputValue}
      />
    )
  }
}

Environment

Environment:
OS: macOS High Sierra 10.13.4
Node: 8.9.1
Yarn: 1.6.0
npm: 5.7.1
Watchman: 4.9.0
Xcode: Xcode 9.3 Build version 9E145
Android Studio: 3.1 AI-173.4720617

Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: 0.55.3 => 0.55.3

@react-native-bot react-native-bot added Platform: iOS iOS applications. Component: TextInput Related to the TextInput component. 📋Needs Repro Steps labels May 7, 2018
@mydesweb
Copy link
Author

mydesweb commented May 7, 2018

@react-native-bot I added also Repro Steps

@jnberry
Copy link

jnberry commented May 10, 2018

Same issue here. However, it seems that the TextInput will update with the state value if that state value is modified from the last render. Otherwise, the TextInput uses what the user typed, not what is passed in via the value prop.

As you said, this prevents input filtering.

Environment:
OS: macOS High Sierra 10.13.4
Node: 8.1.2
Yarn: Not Found
npm: 5.6.0
Watchman: 4.7.0
Xcode: Xcode 9.3 Build version 9E145
Android Studio: Not Found

Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: 0.55.4 => 0.55.4

@francisli
Copy link

Maybe a duplicate of #18874 ...?

@stale
Copy link

stale bot commented Aug 12, 2018

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 "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Aug 12, 2018
@stale
Copy link

stale bot commented Sep 6, 2018

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.

@stale stale bot closed this as completed Sep 6, 2018
@facebook facebook locked as resolved and limited conversation to collaborators Sep 6, 2018
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. Platform: iOS iOS applications. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

4 participants