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

returnKeyType prop of TextInput is not updated after state has changed #23362

Closed
Bradzer opened this issue Feb 10, 2019 · 1 comment
Closed
Labels
Bug Component: TextInput Related to the TextInput component. Platform: Linux Building on Linux. Resolution: Locked This issue was locked by the bot.

Comments

@Bradzer
Copy link

Bradzer commented Feb 10, 2019

🐛 Bug Report

The value of returnKeyType prop of my TextInput component depends on my this.state.signUpChecked.
However, returnKeyType prop value does not update according to changes in this.state.signUpChecked.

To Reproduce

Step 1 : Set initial this.state.signUpChecked to false
Step 2 : Set the TextInput prop like this returnKeyType={this.state.signUpChecked ? 'next' : 'go'}
Step 3 : Component renders and the returnKeyType has the expected icon go.
Step 4 : Check the Sign up checkbox that changes the this.state.signUpChecked to true
Step 5 : Open keyboard after component rerendered and returnKeyType still has the icon go

Expected Behavior

Step 5 : The keyboard is instead expected to have the icon next

Code Example

returnKeyType={this.state.signUpChecked ? 'next' : 'go'}

Environment

React Native Environment Info:
System:
OS: Linux 4.15 Linux Mint 19.1 (Tessa)
CPU: (4) x64 Intel(R) Core(TM) i5-3340M CPU @ 2.70GHz
Memory: 309.06 MB / 7.66 GB
Shell: 4.4.19 - /bin/bash
Binaries:
Node: 10.15.0 - ~/Documents/nodejs/bin/node
npm: 6.7.0 - ~/Documents/nodejs/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
Android SDK:
API Levels: 23, 24, 25, 26, 27, 28
Build Tools: 27.0.3, 28.0.2, 28.0.3
System Images: android-23 | Intel x86 Atom_64, android-23 | Google APIs Intel x86 Atom_64, android-24 | Google APIs Intel x86 Atom_64, android-25 | Google APIs Intel x86 Atom_64, android-26 | Google APIs Intel x86 Atom_64, android-27 | Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom_64
npmPackages:
react: 16.6.3 => 16.6.3
react-native: 0.58.3 => 0.58.3
npmGlobalPackages:
apsl-react-native-button: 3.1.1
react-native-button-component: 0.2.28
react-native-cli: 2.0.1
react-native-elements: 0.19.1
react-native-vector-icons: 6.1.0

@react-native-bot react-native-bot added Component: TextInput Related to the TextInput component. Platform: Linux Building on Linux. labels Feb 10, 2019
@cpojer
Copy link
Contributor

cpojer commented Apr 2, 2019

You are right, this seems like this is a real issue but unfortunately it's unlikely anyone will be able to spend time on this anytime soon. I'm going to close this issue but we are more than happy to receive a pull request with a fix for this!

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

No branches or pull requests

3 participants