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

iOS: Possible fix for #26577 #26653

Closed
wants to merge 1 commit into from

Conversation

partiellkorrekt
Copy link

@partiellkorrekt partiellkorrekt commented Sep 30, 2019

See #26577 for the idea behind this change

Summary

When rendering a view nested inside a text on iOS 13 there will be a document icon behind this view. That's because RN uses attachments to make the text flow around the child-views.

This code replaces the attachment image with an empty image so that the rendered output looks like expected.

Changelog

[iOS] [Fixed] - Remove the document-icon behind childviews of text

Test Plan

See #26577 for an example where the old code would render incorrectly. The new code renders just like it's expected.

I also added many of childviews to different texts and added NSLog-statements to verify that only one empty placeholder-image gets created.

Since I'm not normally developing in Objective-C it might be a good idea for someone else to have a look at it and see if this is a good way to do it.

See facebook#26577 for the idea behind this change
@facebook-github-bot
Copy link
Contributor

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@pull-bot
Copy link

Messages
📖

📋 Verify Changelog Format - A changelog entry has the following format: [CATEGORY] [TYPE] - Message.

CATEGORY may be:
  • General
  • iOS
  • Android
  • JavaScript
  • Internal (for changes that do not need to be called out in the release notes)

TYPE may be:

  • Added, for new features.
  • Changed, for changes in existing functionality.
  • Deprecated, for soon-to-be removed features.
  • Removed, for now removed features.
  • Fixed, for any bug fixes.
  • Security, in case of vulnerabilities.

MESSAGE may answer "what and why" on a feature level. Use this to briefly tell React Native users about notable changes.

Generated by 🚫 dangerJS against c59b603

@react-native-bot react-native-bot added the Platform: iOS iOS applications. label Sep 30, 2019
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 30, 2019
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@kristerkari
Copy link

I ran the code from this PR using patch-pacakge agaist the test/repro repository that I created.

It does fix the iOS 13 bug:
kristerkari/react-native-ios-13-view-or-image-inside-text-bug#1

@PeteTheHeat
Copy link
Contributor

Thanks for submitting this! I ended up using a similar strategy and fixing this bug in

06599b3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Platform: iOS iOS applications.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants