-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TextInput: long text results in linebreak #2581
Comments
Couldn't find version numbers for the following packages in the issue:
Can you update the issue to include version numbers for those packages? The version numbers must match the format 1.2.3. The versions mentioned in the issue for the following packages differ from the latest versions on npm:
Can you verify that the issue still exists after upgrading to the latest versions of these packages? |
It seems to be caused by the You can passdown |
Unfortunately this is not working. Either adding textAlign:'auto' | 'left' | 'right' nor leaving the property out to take the default has no effect (#2445 I am using the latest paper version). EDIT: I've added textAlign: 'auto' in the style and this fixed the issue. First I thought you mean the textAlign property of TextInput. Now it's clear for others i hope. |
I my case Additionally, I recognized the following behavior in development:
Initially, it renders correctly (except of missing ellipsis) and changes result in line breaks. |
This issue still occur |
In my case |
Still reproduce such issue |
In my case textAlign={"auto"} works, but the placeholder is no longer centered |
For people that use styled-components together with react-native-paper just add into your styling text-align: auto and it works:
|
Still seeing this issue. Adding |
Same here |
Not working with textAlign: 'auto', undefined. Tried as a prop for TextInput as well as in 'style'. Tried in ios simulator |
Hi, I have figured it out. If some else thinks that this solution is not working for you then try using it with |
@aannaassalam which version u are using coz i am using ( "react-native-paper": "^5.11.1") it's not working. i am using overflow hidden to make useable currently it look like in the example image. Edit: after i did some tinkering, this issue only occur in mode={"outlined"} ; flat is working fine. |
This bug occurs on IOS in my case. On android it seems to be rendered correct. I tried it on IOS simulator and IOS physical device as well. Both are showing the bug. So it seems to be an IOS issue. |
Yes, you should pass it to style prop instead of passing it to the component and again there was a mistake in my comment textAlignVertical is not the correct way to do that. |
Here is my piece of working code -
Styles:
|
error still exist |
Same error on iOS |
Have you solved the problem yet? You can use: inputStyle: {
textAlign: 'auto',
lineHeight: undefined,
} I think it can help you solve the problem! |
Ran into the same issue when I updated the react-native-paper library. Have submitted a pull request #4261 which has fixed it. Fixed as of 5.12.0 |
hi everyone, I have the same problem and I am fixing it by removing it from the input styles leaving only the fontSize I hope this helps. if it helped, a like is welcome |
Current behaviour
Typing a long text in TextInput and unfocusing it breaks the line
Expected behaviour
Text is cut off at the end and is only visible by scrolling while editing
Code sample
Screenshots (if applicable)
What have you tried
set numberOfLines to 1 and multiline to false
Your Environment
The text was updated successfully, but these errors were encountered: