-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
fix: Prevent text from being cut off in mobile OfflineStatus component #57783
Conversation
Size Change: 0 B Total Size: 1.7 MB ℹ️ View Unchanged
|
@dcalhoun As this component is yet to be released, I do not believe a CHANGELOG update is required, as we'd be covered by the following:
WDYT? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[...] As this component is yet to be released, I do not believe a CHANGELOG update is required [...]
I agree.
I verified the fix with a Samsung Galaxy S20
What?
Resolves an Android issue where text was being cut off in the OfflineStatus component when bold text was being used.
Why?
This appears to be a legitimate bug in React Native:
When a bold typeface style is used, the last node of the text appears to be removed.
When there are two or more words in one
<Text>
element, the last word is removed:When there is one word in a
<Text>
element, the last letter is removed:When there are two or more words in one
<Text>
element and a space is added, the space is removed:How?
This PR adds a space to the end of the element in OfflineStatus to workaround the issue. This space does not appear to impact the UI.
Note: the space appears outside of the i18n string to avoid invoking the i18n-no-flanking-whitespace linter error.
This PR also removes an extra
<View style={ containerStyle }></View>
that appears to be redundant from its parent.Testing Instructions
Testing note: I was not able to consistently reproduce the original issue across various Android devices. I was not able to replicate the issue on a Samsung Galaxy FE20 or Google Pixel 6 Pro, but could consistently replicate it on a Pixel One.