-
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
[0.54] <Text> rendering last line truncated (sometimes) #18258
Comments
Here's a twist. I see that on both iPhone 6s (device) and iPhone 6 (simulator), no truncation on last line of Could it be something to do with 3x pixels per point on the X? I haven't tested on plus versions of iPhones yet. Something to do with calculated number of lines expected by RN mismatching what's actually rendered? |
+1, i am now not only facing this problem, but also the text component just cropped some of content at the last line of the text. It is not happened in other ios devices, but it happens in iPhoneX. |
I have just fixed only cocoapods related issue. |
Ok, I downgraded RN back to 0.53 since there's no uptake on fixing |
We see the same behavior where the text doesn't wrap and get's chopped on an iPhone X. Here is our workaround for now.
|
@Rnorback I've tried playing with paddings already and it doesn't work. What gets chopped on the last line happens regardless of paddingVertical. paddingHorizontal would change where word wrap occurs so same I'd love to use a workaround if there's one. For now, I'm staying on RN 0.53.3. |
a534672 supposed to fix that. Can anyone double check? |
I confirm this is fixed (for my app and test cases) in RN 0.54.3. Thanks |
I encountered a similar issue (with iPhone X only) on RN 0.55.2. |
That's interesting. Another regression?? I haven't upgraded to 0.55 yet, I'm still on 0.54.4 and no issue with iPhone X there. I'm reopening. @chrmcg if you can provide more details like screenshot of issue on RN 0.55 that'd be useful. |
Thanks @fungilation. Sorry for delayed response. Expected behavior (screenshot from RN 0.54.3): Observed problem behavior (screenshot from RN 0.55.2): The difference is in the name of the first user -- note how on 55.2 it gets clipped instead of wrapped, although the vertical offset from the center is there as if it were going to be wrapped. Relevant code for this snippet:
Anecdotally this behavior appears to be rare but deterministic. If you rename one of these users, sometimes it fixes the problem; other times a different user starts exhibiting the problem. Pretty weird! Let me know if I can provide any more info. |
Looks like the same issue I had. @shergin help please? |
0.55.2 has the same issue |
@grabbou or anyone else, this issue is dangling and a pretty important one to us who target the iPhone X (and Plus models too I'm guessing, which shares a device pixel of 3). Can correct tags/labels be added to this issue for more attention please? |
That looks like regression to me. I am wondering what could've caused it. CC: @shergin for his work on Text component and @emilsjolander for his Yoga layout work. Any of you recognizes what could be causing troubles here? (see the screenshot above) |
This comment has been minimized.
This comment has been minimized.
No bot we just mentioned 0.55 reproduction. |
As much as I don't want to... bump for how much we care about this. |
Bump for some love? As I don't see this issue with |
Bump - this is still an issue on 0.55.4 without an apparent fix in 0.56? |
Yeah, this issue is blocking my company from upgrading beyond 0.53, which coincides with the It's incredibly difficult to understand why and how a component has changed when it's simply a commit that lands in a project with little explanation. It's much easier to understand when there is ample conversation, and historical reasoning (usually in the form of an issue and PR), rather than a diff landing out of nowhere. It would be great to have some sort of a post-mortem about the text rewrite, or further documentation on the internals of the text component so that we can help contribute back to this project once again. |
Additionally, the |
Note that this issue appeared (for me) in RN 0.54.0, and was fixed by 0.54.3 or 0.54.4. My app WonderSwipe is on 0.54.4 without this issue. Haven't upgraded beyond as reported above, issue has reappeared in 0.55 and is a blocker |
Has someone actually verified this on |
Updating to 0.56.0-rc.1 seems to address these issues for my application. I don't know how to create a repro case for this to ensure that we don't run into this regression again, due to not knowing what commit fixed this issue... |
@eliperkins Great to hear. For at least some optics for what's happening, can you post screenshots of before (0.55 or 0.53-) and after (0.56) with how Text rendering failed and worked correctly again? |
This comment has been minimized.
This comment has been minimized.
@fungilation is it fixed in 0.56 in your case? |
Haven't tested yet. Waiting for 0.56 release to drop |
The 0.56 release candidate has been available for a couple of weeks now. |
Release != RC. Does RCs work as a target for upgrade via react-native-git-upgrade? |
You should be able to upgrade to the RC. We want as many people as possible, especially anyone filing issues in the repo, to be on the latest release candidate, to ensure we're not chasing issues that have already been fixed. |
Ok, did a Closing this issue unless this somehow come back to haunt us past 0.56.0. Would be nice to be able to trace back to what code changes fixed this, between last known bugged version of 0.55.2 / 0.55.3, to now fixed in 0.56.0-rc.1 / 0.56.0-rc.4. Mystery fixes are bad for future prevention. |
I agree. We've been toying with the idea of requesting that a failing test case be added as part of filing some types of issues. That process would be a good way of demonstrating the failure in a minimal way, and help bubble up any commit that fixes it. |
The trouble with this case is it's not known what exact condition causes it, other than certain text boxes on devices with devicepixel 3 (iPhone X) with certain height triggers it. In the apps we make/test. I've documented as much as I can on how an independent reproducible case could be made with data I see in my app, originally under "Steps to Reproduce". |
0.57 has the same issue, test case like below: <Text
numberOfLines={3}
style={{
color: '#555',
fontSize: 15,
lineHeight: 22,
textAlign: 'justify',
marginTop: 10,
}}
>
没事看看这是妈妈的吗羡慕吗羡慕羡慕吗羡慕羡慕羡慕羡慕羡慕羡慕蜂蜜蜂蜜马芳吗多么吗羡慕羡慕羡慕羡慕羡慕们出门出门出门呢想念你承诺承诺发怒你想念羡慕羡慕羡慕吗羡慕羡慕羡慕羡慕多么多么美的你都目瞪口呆口袋空空的口袋宽松款的马德里队来了多么多么羡慕羡慕吗羡慕羡慕羡慕羡慕羡慕羡慕羡慕吗羡慕羡慕羡慕这么美...
</Text> |
Nope, cannot reproduce in my app, with English. RN 0.57.0 |
I'm very sure this bug is still existed with 0.57, please test my code above on iPhone8 plus. |
@musicode you may want to open a new issue to track the problem you're seeing. We rarely keep track of closed issues. |
Environment
Expected Behavior
<Text>
views render without truncation where it shouldn't happen.Actual Behavior
See these screenshots of my app. Pay attention to the 1st and 3rd Text views.
With
numberOfLines={50} ellipsizeMode="middle"
in<Text>
:Without
numberOfLines={50} ellipsizeMode="middle"
in<Text>
:I included 2 screenshots, with or without
ellipsizeMode
to show how it renders differently, but truncated in each case (in the 1st and 3rd Text views). The enclosingView
wrapping theText
view preserve correct height if the Text view wasn't truncated, leaving an empty line on the bottom. Truncation happens on the second last line, as ifnumberOfLines
is set to rendered lines - 1.Notice that the unintended truncation doesn't happen with every Text view, only some. And the truncation happens with various lengths on what should have been the last line, so I'm not sure what's the condition for triggering it.
This unwanted truncation started on RN 0.54, not 0.53 and below. Obviously something about rendering calculation with the Text view rewrite/revamp in 0.54.
Steps to Reproduce
The views are rendered with a structure like
For the 2 truncated Text views, these are the text contained within on array index 9 and 11:
Screenshots above are on the iPhone X simulator. On physical device, it has different reproducibility but also occurs on different text. Screen width and number of words rendered per line is slightly different between simulator and on an actual iPhone X.
And for reference, my app
package.json
:The text was updated successfully, but these errors were encountered: