-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Inconsistent scaling with adjustsFontSizeToFit and numberOfLines=1 #16124
Comments
For anyone else encountering this, as temporary workaround we're adding a regular space followed by a non-breaking space: |
Finally found someone else with this issue! I have been searching like crazy to find an answer. Has anyone else found a solution besides the hacky workaround?? |
I'm also looking for a better solution for this, i've made a calculator where the text scales if the input is a big number. When it starts to scale, the last char is sometimes cut of :( |
I've been struggling for days on this and I believe the trick is to use a mono-spaced font family as well, like |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions. |
Is this a bug report?
Yes
Have you read the Contributing Guidelines?
Yes
Environment
Environment:
OS: Linux 4.12
Node: 8.5.0
Yarn: 1.0.1
npm: 5.3.0
Watchman: 4.7.0
Xcode: N/A
Android Studio: Not Found
Packages: (wanted => installed)
react: 16.0.0-alpha.12 => 16.0.0-alpha.12
react-native: 0.48.4 => 0.48.4
Target Platform: iOS (9.3.5)
Steps to Reproduce
adjustsFontSizeToFit
andnumberOfLines={1}
style={{flex: 1}}
on both elements.Expected Behavior
The paragraph inside the text element is adjusted to fit on a single line, with every word visible.
Actual Behavior
The paragraph is scaled to fit, but inconsistently. Sometimes the last word is cut off. Adding/removing a word sometimes fixes this. See screenshot.
Reproducible Demo
https://snack.expo.io/BkXvD4qjb
The text was updated successfully, but these errors were encountered: