question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[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

image

image

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:closed
  • Created 5 years ago
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
UZIhuhuhucommented, Mar 22, 2019

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.

<TouchableOpacity style={{height: 40}}>
  <TextInput />
</TouchableOpacity>
1reaction
rickhanloniicommented, Mar 20, 2019

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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

react native - TextInput Typed Text not appearing on android
Currently, I have a login screen set up, but both the typed text and placeholder text used within textInput is not showing in...
Read more >
Text in Compose - Jetpack
The most basic way to display text is to use the Text composable with a String as an ... Right aligns to the...
Read more >
TextInput
TextInput. A foundational component for inputting text into the app via a keyboard. Props provide configurability for several features, ...
Read more >
Text fields - Material Design
Note: The android:hint should always be set on the TextInputLayout instead of on the EditText in order to avoid unintended behaviors. Input text...
Read more >
<input type="text"> - HTML: HyperText Markup Language | MDN
The text must not include carriage returns or line feeds. ... you can specify the number of characters the text input can display...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found