You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TextInput with TextAlign on iOS does not add ellipsis instead wraps #29068
Write some long text into the first field with spaces.
Write similar text into the second field.
Unfocus second input
Expected: both fields will have ellipsis at the end
Actual: second input with textAlign doesn't have ellipsis.
Android app works in a different way:
It never shows ellipsis but if you type a long string it always shows the end of it and never beginning. I guess it should move to begin when unfocused.
@JNUfeatherwit can you elaborate on your vertical padding solution? There is no "CSS" in react-native so that is confusing to me. Applying vertical padding in the style for a TextInput isn't changing any of the wrapping behavior for us.
Having investigated, I believe the issue is in the RCTUITextField (which backs the single-line TextInput component) implementation itself. Text content is being set to the underlying UITextField using attributedText. Attributed text strings in iOS have a default paragraph style that permits wrapping. I was able to patch RCTUITextField with the following to change the default paragraph style to truncate, and this works. We're going to run with this patch for a while to see if it's a good fix, but would love to have additional feedback on this as a solution.
Just found out this bug, because I'm using react-native-paper and due to this callstack/react-native-paper#2684 issue and was able to find a solution inside the downstream issue
Shame that this issue is now 2 years old, and to me it seems critical to be resolved as beginners could stumble on this and get their frustration level rising
To clarify, adding a slight vertical padding to the TextInput element does not always work, you've got to experiment and figure out what works without overflowing the text input.
@JNUfeatherwit can you elaborate on your vertical padding solution? There is no "CSS" in react-native so that is confusing to me. Applying vertical padding in the style for a TextInput isn't changing any of the wrapping behavior for us.
Having investigated, I believe the issue is in the RCTUITextField (which backs the single-line TextInput component) implementation itself. Text content is being set to the underlying UITextField using attributedText. Attributed text strings in iOS have a default paragraph style that permits wrapping. I was able to patch RCTUITextField with the following to change the default paragraph style to truncate, and this works. We're going to run with this patch for a while to see if it's a good fix, but would love to have additional feedback on this as a solution.
Thanks for the issue. I have been contributing to facebook/react-native for 4 years and specialize in the Text/TextInput components. I currently have 58 facebook/react-native PRs:
Would like to see this resolved as well. It's quite pesky that even with multiline={false} there is text that is able to wrap to the next line if a TextInput is not focused.
This seems like a very core issue. Basic inputs like a text field is something I think everyone would expect to work in its basic form (i.e. just input long text).
@JNUfeatherwit can you elaborate on your vertical padding solution? There is no "CSS" in react-native so that is confusing to me. Applying vertical padding in the style for a TextInput isn't changing any of the wrapping behavior for us.
Having investigated, I believe the issue is in the RCTUITextField (which backs the single-line TextInput component) implementation itself. Text content is being set to the underlying UITextField using attributedText. Attributed text strings in iOS have a default paragraph style that permits wrapping. I was able to patch RCTUITextField with the following to change the default paragraph style to truncate, and this works. We're going to run with this patch for a while to see if it's a good fix, but would love to have additional feedback on this as a solution.
Can confirm the issue is still present in React Native 0.88.1 on iOS 26.5 and iOS 17.5. When textAlign is set to right, a long value is truncated without an ellipsis and is aligned to the left edge instead of the right.
Activity
shreypdev commentedon Jul 4, 2021
@JNUfeatherwit Adding VerticalPadding through CSS solves the issue of multiline but still no ellipsis.
JNUfeatherwit commentedon Jul 5, 2021
Wow! It Actually works! Thank you
kokiebisu commentedon Oct 1, 2021
This issue is still persisting. Adding the verticalPadding does not ultimately solve the problem. Any updates?
TomSwift commentedon Dec 3, 2021
@JNUfeatherwit can you elaborate on your vertical padding solution? There is no "CSS" in react-native so that is confusing to me. Applying vertical padding in the style for a TextInput isn't changing any of the wrapping behavior for us.
Having investigated, I believe the issue is in the
RCTUITextField(which backs the single-line TextInput component) implementation itself. Text content is being set to the underlying UITextField usingattributedText. Attributed text strings in iOS have a default paragraph style that permits wrapping. I was able to patch RCTUITextField with the following to change the default paragraph style to truncate, and this works. We're going to run with this patch for a while to see if it's a good fix, but would love to have additional feedback on this as a solution.In
RCTUITextField.m:mohamedanwer123 commentedon Jan 17, 2022
any updates ?
any solution ?
osmyn commentedon Mar 11, 2022
This is the workaround mentioned above:
thiagobutignon commentedon Apr 29, 2022
Any updates?
tiagomsmagalhaes commentedon Jun 30, 2022
Just found out this bug, because I'm using
react-native-paperand due to this callstack/react-native-paper#2684 issue and was able to find a solution inside the downstream issueShame that this issue is now 2 years old, and to me it seems critical to be resolved as beginners could stumble on this and get their frustration level rising
GameraCC commentedon Aug 22, 2022
To clarify, adding a slight vertical padding to the
TextInputelement does not always work, you've got to experiment and figure out what works without overflowing the text input.Solution below:
riledv commentedon Aug 26, 2022
Oh... crap It needs to be fixed
frenberg commentedon Nov 30, 2022
Hey @TomSwift are you still using this patch or did you find any problems with it?
projectnatz commentedon Feb 7, 2023
Issue still open in react-native 0.70.6 😢
mikekreeki commentedon Jul 13, 2023
Still an issue.
yourjhay commentedon Oct 28, 2023
Sometimes textAlign works, sometimes not.
fabOnReact commentedon Jan 18, 2024
Hello,
Thanks for the issue. I have been contributing to facebook/react-native for 4 years and specialize in the Text/TextInput components. I currently have 58 facebook/react-native PRs:
https://github.com/facebook/react-native/pulls?q=is%3Apr+author%3Afabriziobertoglio1987+
This is the suggested approach from the react-native core team (see this discussion):
I'm publishing several fixes for Text and TextInput component in a separate library react-native-improved.
The advantages would be:
What do you think about this? Should I keep working on this? Thanks
sieeniu commentedon Mar 25, 2024
any updates?
seanmaisch commentedon Apr 3, 2024
Would like to see this resolved as well. It's quite pesky that even with
multiline={false}there is text that is able to wrap to the next line if aTextInputis not focused.MateuszBukowski93 commentedon Apr 4, 2024
Still doesn't work.
fix for me:
Fixed height
TomasSestak commentedon Apr 15, 2024
would be nice to have this working
thiagobutignon commentedon Apr 15, 2024
Almost 4 years without a solution!
tibbe commentedon May 2, 2024
This seems like a very core issue. Basic inputs like a text field is something I think everyone would expect to work in its basic form (i.e. just input long text).
ilight commentedon May 9, 2024
This worked for me, thank you @TomSwift
shubhamguptadream11 commentedon Aug 24, 2024
This is going to be fixed here: #45968
Basically now you need to use a prop lineBreakModeIOS with break strategy you want.
react-native-bot commentedon Feb 21, 2025
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.
SimpleCreations commentedon Feb 22, 2025
Can anyone confirm that this issue can be fixed by using the
lineBreakModeIOSprop?gulshercb7 commentedon Apr 29, 2025
I can confirm that using lineBreakModeIOS does not fix the issue.
steinalex commentedon May 14, 2025
Does anyone have a good solution to this (other than manually adding padding)? Still seeing this issue on "react-native": "0.76.7"
Mehdi-Abbas commentedon Jun 17, 2025
lineBreakModeIOS didn't work for me, but setting textAlign: 'auto' (in style) did the job
DanielAraldi commentedon Nov 6, 2025
I have the same problem in RN 0.79.3...
react-native-bot commentedon May 6, 2026
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.
tibbe commentedon May 6, 2026
Still broken.
react-native-bot commentedon Nov 4, 2026
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.
SimpleCreations commentedon Nov 4, 2026
Can confirm the issue is still present in React Native 0.88.1 on iOS 26.5 and iOS 17.5. When
textAlignis set toright, a long value is truncated without an ellipsis and is aligned to the left edge instead of the right.