Test app for react-native TextInput bugfix.
This is a test app for the pull request for react-native.
react-native 0.54.0 has a bug which textInputRef.setNativeProps({text: ''}) doesn't work.
You can check if the pull request fixes the bug.
[0.54] TextInput.setNativeProps({text: ''}) no longer works (#18272)
TextInput value not binding on IOS (#18389)
[iOS][TextInput] Fix #18272 TextInput.setNativeProps({text: ''}) to work (#18278)
git clone https://github.com/magicien/react-native-textinput-clear.git
cd react-native-textinput-clear
yarn install
react-native run-ios
If react-native run-ios
command ends up with error, compile with Xcode.
git clone -b test/react-0.54.0 https://github.com/magicien/react-native-textinput-clear.git
cd react-native-textinput-clear
yarn install
react-native run-ios
If react-native run-ios
command ends up with error, compile with Xcode.
- Tap
clear
button- The TextInput should become empty
- Put some text in the TextInput
- Tap
clear
button- The TextInput should become empty
- It doesn't become empty with react 0.54.0
- Tap
clear
button- The TextInput should become empty
- Tap
reset
button- The TextInput should change
- Change the text in the TextInput by keyboard
- Tap
reset
button- The TextInput should change
- It doesn't change with react 0.54.0
- Try to edit the TextInput at "Singleline with value"
The text should not be changed
- Move the slider at "Attribute"
It should keep the font style (font family, size, color, text align)
clear()
doen't work from the second timesetNativeProps({text '***'})
doesn't work from the second time
clear()
works every timesetNativeProps({text '****'})
works every time
onChange / onChangeText won't be called when setNativeProps({text: ''})
is called.
This is the same as react 0.53.0.
When non-string values are given to setNativeProps({text: ___})
, its behavior is the same as react 0.53.0.
Value Type | Result |
---|---|
null | same as empty string '' |
undefined | nothing changes |
number | throw error |
function | throw error |
object | throw error |