Skip to content

Problem with lineHeight in TextInput #31112

Open

Description

@wiru123321

Hi! 👋

I found some bug with TextInput.
When i change the lineHeight props for my custom - three dots at the end of the TextInput when the text is too long disappears.
react-native: "0.63.4"

Zrzut ekranu 2021-03-8 o 16 35 13

Activity

  1. added
    Component: TextInput
    on Mar 9, 2021
  2. chrisglein commented on Mar 9, 2021

    @chrisglein

    This sounds very familiar. I've seen other TextInput + ellipses issues come through but I'm having a hard time finding this. You can help look through here.
    It'd be helpful if there was a Snack or at least copy-able version of your repro instead of a screenshot.

  3. added
    Needs: Environment Info
    Needs: Issue Template
    Needs: Repro
    and removed on Mar 9, 2021
  4. github-actions commented on Mar 9, 2021

    @github-actions
    ⚠️ Missing Reproducible Example
    ℹ️ It looks like your issue is missing a reproducible example. Please provide a Snack or a repository that demonstrates the issue you are reporting in a minimal, complete, and reproducible manner.
  5. github-actions commented on Mar 9, 2021

    @github-actions
    ⚠️ Missing Environment Information
    ℹ️ Your issue may be missing information about your development environment. You can obtain the missing information by running react-native info in a console.
  6. github-actions commented on Mar 9, 2021

    @github-actions
    ⚠️ Missing Required Fields
    ℹ️ It looks like your issue may be missing some necessary information. GitHub provides an example template whenever a new issue is created. Could you go back and make sure to fill out the template? You may edit this issue, or close it and open a new one.
  7. wiru123321 commented on Mar 10, 2021

    @wiru123321
    Author

    My environment info:
    Zrzut ekranu 2021-03-10 o 09 13 07
    Here is simple example - test it on iOS because here is the problem:
    https://snack.expo.io/bL9-PEM1e

  8. added
    Needs: Attention
    and removed on Mar 10, 2021
  9. SusulAdam commented on Mar 15, 2021

    @SusulAdam

    Hi!

    I have the same problem, i try implement custom font to the project with different line height to the textfield. Unfortunately three dots at the end of the Text Input when the text is too long disappears.

  10. wiru123321 commented on Mar 19, 2021

    @wiru123321
    Author

    If u looking for fast but not perfect solution u can set lineHeight to undefined after changed font styles for custom, but i'm waiting for better solution.

  11. anwargul0x commented on Mar 19, 2021

    @anwargul0x

    not only it affects trimming but it also doesn't show new input text after a certain character length or width of TextInput

  12. added
    Issue: Author Provided Repro
    and removed
    Needs: Attention
    Needs: Environment Info
    Needs: Issue Template
    Needs: Repro
    on Apr 20, 2021
  13. NandoMB commented on May 25, 2023

    @NandoMB
  14. fabOnReact commented on May 25, 2023

    @fabOnReact
    Contributor

    My PR did not yet fix this issue, but a similar solution can also fix this issue

    As you see, adding lineHeight changed the width of the _UITextLayoutFragmentView. As the view changes width from 138 to 119, which is the reason the ellipsis does not show.

    Screenshot 2023-05-25 at 2 03 59 PM Screenshot 2023-05-25 at 2 03 56 PM
  15. castrolem commented on Sep 4, 2025

    @castrolem

    Besides the ... I'm also seeing that when I introduce a lineHeight on any text input the behavior shown on Expensify/App#14799 occurs, where the first character seems to re-render the input, this happens when I do a text input that's multiline={true} and I see the minHeight to a value that's higher than 2 lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: TextInputIssue: Author Provided ReproNeeds: Issue Manager Attention

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions