returnKeyType prop of TextInput is not updated after state has changed #23362
Labels
Bug
Component: TextInput
Related to the TextInput component.
Platform: Linux
Building on Linux.
Resolution: Locked
This issue was locked by the bot.
🐛 Bug Report
The value of
returnKeyType
prop of my TextInput component depends on mythis.state.signUpChecked
.However,
returnKeyType
prop value does not update according to changes inthis.state.signUpChecked
.To Reproduce
Step 1 : Set initial
this.state.signUpChecked
tofalse
Step 2 : Set the TextInput prop like this
returnKeyType={this.state.signUpChecked ? 'next' : 'go'}
Step 3 : Component renders and the
returnKeyType
has the expected icongo
.Step 4 : Check the Sign up checkbox that changes the
this.state.signUpChecked
totrue
Step 5 : Open keyboard after component rerendered and
returnKeyType
still has the icongo
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
The text was updated successfully, but these errors were encountered: