-
-
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
Text within button is truncated by default if character length of text is equal to 10 #3472
Comments
Hey @goofygoobers, does the issue exists on the stable v5 e.g. |
|
Could you please try to investigate the issue once you're able to reproduce the problem? |
I think it's an issue with React Native itself, currently, I found three ways to get around this problem:
So I avoid this issue by custom theme now: const fontConfig = {
titleSmall: {
letterSpacing: 0.101
},
labelLarge: {
letterSpacing: 0.101
}
}
export default {
...MD3LightTheme,
fonts: configureFonts({ config: fontConfig, isV3: true })
} |
Hey @sapjax, thanks for your input! Were you able to observe the same issue with the regular react-native's |
react-native's Text / Touchable / Pressable component has no problem when After some tests, I found that the problem is caused by the On Android, users can adjust the font size and font display size in settings, but ColorOS can override all font-family in settings, and the default font display size is bigger than normal: if I lower the display size or change font-family from |
Closing the issue, since the problem is related to the specific device and its internal display settings, so it's hard to apply the fix, which will fit in all the users cases. The mentioned solution can be applied manually to the projects, which are affected by that problem. |
Also having this issue with text length of every multiple of 5, when system font size is set to "Default". |
I'm also having this issue with text length of every multiple of 5, when system font size is set to "Default". So far I've noticed it on the Mobicell Legend Pro Lte on Android 11 and with an emulated Galaxy Nexus API 30 device with a 720p 4.65 display with Android 11. The only way I was able to fix it so far was to add spaces to increase the text length. The letterspacing wasn't the problem in my case. Would be very cool if we can get a fix for it. |
I am seeing this too. This is on react-native-paper 5.13.1. |
Current behaviour
This issue is specifically found when emulating an Samsung S22 device.
When the text is exactly 10 characters long, it is automatically truncated.
Expected behaviour
The expected behaviour is for the text in the button to not be truncated.
How to reproduce?
https://snack.expo.dev/9wx1ycteed
Preview
As shown below, the "Statements" button on the second row is truncated.
This is not a problem on IOS simulator as shown below.
What have you tried so far?
Your Environment
The text was updated successfully, but these errors were encountered: