Skip to content
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] Text is nondeterministically rendered on one line #1459

Closed
ide opened this issue May 30, 2015 · 8 comments
Closed

[Text] Text is nondeterministically rendered on one line #1459

ide opened this issue May 30, 2015 · 8 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@ide
Copy link
Contributor

ide commented May 30, 2015

After the Friday sync (though the Thursday sync could be to blame too), this text rendering bug appeared where text that should wrap was rendered on a single line. Notably the layout of the screen is correct, it's just the text drawing that's wrong. Refreshing the bridge and root view made the issue go away.

Screenshot (drop shadow was applied after screenshotting):
text

cc @nicklockwood

@ide
Copy link
Contributor Author

ide commented May 30, 2015

These are <Text> components that don't set a max number of lines. I'm not sure what caused this bug but one hypothesis is that when the NSTextStorage for the RCTText view is created in uiBlockToAmendWithShadowView:, the frame of the shadow view is somehow incorrectly very wide. The NSLayoutManager would think there is enough room to draw the text on one line.

@nicklockwood
Copy link
Contributor

This was a consequence of the text multithreading crash fix. I landed a fix for this yesterday, but it must have just missed the branch cut.

@ide
Copy link
Contributor Author

ide commented May 30, 2015

That's great to hear. I'll close this out.

@ide ide closed this as completed May 30, 2015
@ide
Copy link
Contributor Author

ide commented Jun 12, 2015

I'm seeing this with master still (up to and including the June 10 sync). Once I tap the screen the text reflows properly but occasionally it is rendered all on one line.

@ide ide reopened this Jun 12, 2015
@nicklockwood
Copy link
Contributor

Is this only happening for you when the screen is rotated / RCTRootView is resized?

If so, I have a fix.

If not, can you provide steps to reproduce?

@ide
Copy link
Contributor Author

ide commented Jun 12, 2015

No screen rotation. The root view is smaller than the screen, but it isn't resized after its initial layout is computed... maybe there's a race condition where the content is rendered and then the root view is laid out.

@nicklockwood
Copy link
Contributor

Possibly. I landed a fix for the rotation issue anyway. Once it hits Github, let me know if it's fixed.

If not, a sample app to repro the issue would be super-helpful.

@ide
Copy link
Contributor Author

ide commented Jul 14, 2015

I haven't seen this in the past couple of weeks. Closing it out.

@ide ide closed this as completed Jul 14, 2015
@facebook facebook locked as resolved and limited conversation to collaborators Jul 14, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

3 participants