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.

Inconsistent text behavior in TextInput between iOS and Android

See original GitHub issue

Is this a bug report?

Yes

Have you read the Bugs section of the Contributing to React Native Guide?

Yes

Environment

  1. react-native -v:
react-native-cli: 2.0.1
react-native: 0.45.1

(edit: it reproduces in 0.54.2 according to the comments -@hramos)

  1. node -v: v7.7.2
  2. npm -v: 4.1.2
  3. yarn --version (if you use Yarn): N/A

Then, specify:

  1. Target Platform (e.g. iOS, Android): Android
  2. Development Operating System (e.g. macOS Sierra, Windows 10): macOS Sierra 10.12.5
  3. Build tools (Xcode or Android Studio version, iOS or Android SDK version, if relevant): Android Studio 2.3.2. Compile SDK 23. Build tools 23.0.1

Steps to Reproduce

  1. Create a TextInput that fits 100% width of the screen
  2. Set the TextInput’s value to a string that will render larger than the width of the text view
  3. Run in Android and note which part of the string renders
  4. Run in iOS and note which part of the string renders

Expected Behavior

Both iOS and Android should exhibit the same behavior and display the beginning of the text when unfocused.

Ideally, the ellipsis should also be an optional parameter to display when unfocused on both Android and iOS.

Actual Behavior

iOS displays the beginning of the text, ellipsizing the remaining text before truncating.

screen shot 2017-07-05 at 5 51 34 pm

Android displays the end of the text with no ellipsis at the beginning.

screen shot 2017-07-05 at 5 51 11 pm

Reproducible Demo

Example project: https://snack.expo.io/S1Lty1oN- To view the issue, launch the example project and preview in Android. Then preview in iOS. Note the differences between where ellipsis show and which part of the sentence displays.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:32
  • Comments:36 (2 by maintainers)

github_iconTop GitHub Comments

16reactions
Nualiiancommented, Feb 24, 2021

This issue is still going strong in 0.63.4

11reactions
MickaelNevescommented, Oct 2, 2018

0.57.1 still having this issue. Very sad behavior if we have a long text in Android.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React-native TextInput different behaviour on Android platform
I need to get rid of blinking text cursor but detect when users touches input. As it turns out on IOS platform works...
Read more >
Inconsistent Text behavior in CarPlay - Apple Community
Ever since the latest update, I have seen weird and inconsistent behaviors in the Carplay txt app -- the Audi (and several other...
Read more >
EditableText class - widgets library - Flutter - Dart API docs
Many TextInputActions are common between Android and iOS. ... Intent Class, Default Behavior when there's selected text, Default Behavior when there is a ......
Read more >
The Textarea element - HTML: HyperText Markup Language
The HTML element represents a multi-line plain-text editing control, ... in <input>: The Input (Form Input) element for a full explanation.
Read more >
TextInput - React Native
Note that on Android performing text selection in an input can change the app's activity windowSoftInputMode param to adjustResize . This may ...
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