-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Width of TextInput is wrong with custom font on Android #23629
Comments
Also I sight what TextInput on android have min height related with placeholder length. Maybe this is that case. You can try set empty placeholder while TextInput not empty as a temporary solution. |
@Bardimaswift There is another issue with the placeholder, yes. But this one is not related to placeholder. I just updated the screenshots to make it more visible. If I type |
@temhota Any solution ? |
Not sure if this will help. I was having the same issue with a custom font and textinput. |
Was there an alternative resolution to this aside from adding '.ttf' to the font family? @temhota |
Actually, the .ttf just caused all of my custom fonts to disappear and go to the default font of Roboto. Thank you for asking as I forgot to update this accordingly. To fix this, I actually embedded a within the to display the actual value - the system was then able to calculate and I had no more truncation. So where I formerly had:
It became:
|
This is really a big problem of TextInput. We are developing the mobile application of a known bank using react native and have custom fonts. We are trying to implement an input Amount component which is always horizontally centralized and font-decreasing after a number character length. Also integer part and the decimal part should be independently changable. When we put the two TextInputs, the seperator Text between them and the currency type indicator Text at the end in flex direction "row". TextInputs can't calculate their character widths correctly on Android and distances between components seem too much if we write thin characters like 1 and too less when we write thick characters like 0 or 8 (even they go to the top of the adjacent Text). Are u guys planning to resolve this issue soon? |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions. |
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information. |
🐛 Bug Report
The width of
TextInput
on Android is calculated wrong.Looks like it takes the width of the default font.
See screenshots below:
With default font (looks like it should be):
To Reproduce
Add a
Text
component afterTextInput
(in our caseText
with € sign).Expected Behavior
TextInput
should take the width of its content. The distance betweenTextInput
content and the € sign should always be the same. Content shouldn't be cut.Code Example
Environment
The text was updated successfully, but these errors were encountered: