Text component cuts part of the text if fontWeight bold is used
See original GitHub issue- Review the documentation: https://facebook.github.io/react-native
- Search for existing issues: https://github.com/facebook/react-native/issues
- Use the latest React Native release: https://github.com/facebook/react-native/releases
Environment
React Native Environment Info:
System:
OS: macOS High Sierra 10.13.5
CPU: x64 Intel(R) Core(TM) i5-4278U CPU @ 2.60GHz
Memory: 514.83 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 8.9.0 - ~/.nvm/versions/node/v8.9.0/bin/node
npm: 6.4.1 - ~/.nvm/versions/node/v8.9.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 11.4, macOS 10.13, tvOS 11.4, watchOS 4.3
IDEs:
Android Studio: 3.1 AI-173.4819257
Xcode: 9.4.1/9F2000 - /usr/bin/xcodebuild
npmPackages:
react: 16.5.0 => 16.5.0
react-native: 0.57.2 => 0.57.2
npmGlobalPackages:
create-react-native-app: 1.0.0
react-native-cli: 2.0.1
Description
In some devices when using a <Text> component with the syle fontWeight: 'bold'
it removes the last word of the content of the text. My guess is that it’s related with the latest android version, I could test and reproduce this bug in the OnePlus 6 device.
See how the hello world app renders with/without the font style bold.
Before adding bold style to text
After adding bold style to text
Reproducible Demo
1. react-native init bug
2. Connect an android device OnePlus 6 with latest version of android on the computer
3. Add `fontWeight: 'bold',` to App.js line 45 (instructions styles)
4. Run the app in the device
Issue Analytics
- State:
- Created 5 years ago
- Reactions:19
- Comments:36
Top Results From Across the Web
Text is getting cut off in android for react native - Stack Overflow
This usually happens when you have this: fontWeight:bold and your android device is for example a Oneplus or Oppo (there are some other ......
Read more >Text - React Native
A React component for displaying text. Text supports nesting, styling, and touch handling. In the following example, the nested title and body ...
Read more >Text - Chakra UI
Text is the used to render text and paragraphs within an interface. ... Use Inspect Element to see the element that gets rendered...
Read more >Customize React Native text color and other theme elements
Bold text is typically used to emphasize words and phrases you want the user to see. This could be a benefit, a special...
Read more >font - CSS: Cascading Style Sheets - MDN Web Docs
Syntax · it must include values for: · it may optionally include values for: · font-style , font-variant and font-weight must precede font-size ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I also use a OnePlus and I had this issue. A workaround I used is to set fontFamily to ‘Roboto’
Still having the same issue.
I worked around it by setting
lineHeight
: