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

Percentage value for padding and margin crashes the application #418

Closed
5 tasks done
kenken023 opened this issue Oct 26, 2020 · 1 comment · Fixed by #434
Closed
5 tasks done

Percentage value for padding and margin crashes the application #418

kenken023 opened this issue Oct 26, 2020 · 1 comment · Fixed by #434
Labels
bug Crush'em all.

Comments

@kenken023
Copy link

kenken023 commented Oct 26, 2020

Oath

I swear that I have completed these tasks before submitting:

Decision table

  • My issue does not look like “The HTML attribute 'xxx' is ignored” (unless
    we claim support for it),
  • My issue does not look like “The HTML element <yyy> is not rendered”

Bug Report

Setup

React Native
System:
    OS: macOS 10.15.6
    CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
    Memory: 9.10 GB / 32.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 12.18.3 - /usr/local/bin/node
    Yarn: 1.22.5 - /usr/local/bin/yarn
    npm: 6.14.6 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.9.3 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 13.6, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
    Android SDK: Not Found
  IDEs:
    Android Studio: 4.0 AI-193.6911.18.40.6626763
    Xcode: 11.6/11E708 - /usr/bin/xcodebuild
  Languages:
    Java: 14.0.1 - /usr/bin/javac
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1
    react-native: 0.63.2 => 0.63.2
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found
Libraries
  • react-native-render-html: ^4.2.4
  • react-native-webview: ^10.9.0

Devices

  • Device 1 simulator (iPhone 11)
    • OS: iOS 13.6
    • Diagnostic: reproduction
    • Environment: production and development

Reproduction

Description

When there are percentage value of margin or padding, the application crashes with the following error message:

Error setting property 'margin' of RCTVirtualText with tag #873: JSON value '19% 0' of type NSString cannot be converted to a YGValue. Did you forget the % or pt suffix?
2020-10-26 20:19:54.301581+0800 Wish1075[3183:72044] [native] Error setting property 'margin' of RCTView with tag #877: JSON value '19% 0' of type NSString cannot be converted to a YGValue. Did you forget the % or pt suffix?
2020-10-26 20:19:59.720127+0800 Wish1075[3183:71841] Returning local object of class NSString

(Write your steps here:)

  1. Render the following code snippet
<HTML html={`<html><body><div style="padding: 19% 0;">The quick brown fox jumps over the lazy dog</div></body></html>`}
                  baseFontStyle={{ color: Colors.text }}
                  tagsStyles={tagsStyles}
                  imagesMaxWidth={Dimensions.get('window').width - 40} />
  1. If there are percentage on padding, the application crashes
@kenken023 kenken023 added the bug Crush'em all. label Oct 26, 2020
@kenken023 kenken023 changed the title Percentage value for padding crashes the application Percentage value for padding and margin crashes the application Oct 26, 2020
@jsamr jsamr linked a pull request Nov 26, 2020 that will close this issue
41 tasks
@jsamr jsamr mentioned this issue Nov 26, 2020
41 tasks
@jsamr
Copy link
Collaborator

jsamr commented Nov 26, 2020

This issue has been fixed in the Foundry release. Try it out now! See #430 for instructions.

@jsamr jsamr closed this as completed in #434 Jun 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Crush'em all.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants