[Android] TextInput text is not displayed
See original GitHub issue🐛 Bug Report
The TextInput text is not displayed in Android but it performs well in IOS.
To Reproduce
Expected Behavior
Code Example
<TextInput
style={styles.searchInput}
placeholder={
language
? 'Input Australian Address'
: LanguageMap['Input Australian Address']
}
placeholderTextColor="#54636A"
returnKeyType="search"
autoFocus={isAutoFocus}
editable={editable}
pointerEvents={handlePress === noop ? 'auto' : 'none'}
onChangeText={this.onChangeText}
value={value}
onSubmitEditing={handleSubmit}
blurOnSubmit
/>;
const style = StyleSheet.create({
searchInput: {
flex: 1,
color: '#36404a',
paddingLeft: 8
}
})
Environment
React Native Environment Info: System: OS: macOS 10.14.3 CPU: (8) x64 Intel® Core™ i7-6700HQ CPU @ 2.60GHz Memory: 126.05 MB / 16.00 GB Shell: 5.3 - /bin/zsh Binaries: Node: 10.10.0 - ~/.nvm/versions/node/v10.10.0/bin/node Yarn: 1.13.0 - /usr/local/bin/yarn npm: 6.7.0 - ~/.nvm/versions/node/v10.10.0/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1 Android SDK: API Levels: 23, 25, 26, 27, 28 Build Tools: 27.0.3, 28.0.3 System Images: android-26 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom IDEs: Android Studio: 3.2 AI-181.5540.7.32.5056338 Xcode: 10.1/10B61 - /usr/bin/xcodebuild npmPackages: react: 16.6.1 => 16.6.1 react-native: ^0.57.7 => 0.57.8 npmGlobalPackages: react-native-cli: 2.0.1
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (1 by maintainers)
Top GitHub Comments
I finally fix it. This bug is very unusual. Turns out that the actual size of TextInput’s text is very small.
I can’t see any problems on the simulator. I opened the display layout boundary of the real machine and found that TextInput is too narrow.
In Android, I need to expand the height of the parent container. However, it works well without this config in IOS.
Hey @UZIhuhuhu, thanks for filing - are you able to reproduce in a https://snack.expo.io to rule out any app code that is causing this?