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

Display attribute restricted to "flex" and "none" #282

Closed
wants to merge 3 commits into from

Conversation

jpamarohorta
Copy link
Contributor

If an element has a display attribute that is not flex or none it will give an error (e.g. issue 257).

This PR introduces a validation to only allow those 2 values and default to flex if otherwise.

Thanks for the amazing library!

@jsamr jsamr linked an issue Jul 4, 2020 that may be closed by this pull request
@jsamr
Copy link
Collaborator

jsamr commented Jul 5, 2020

@jpamarohorta Thank you so much for your contribution! We're evaluating the possibility of using this library, https://github.com/styled-components/css-to-react-native, to fix all our issues with translated CSS inline rules. If we do, this PR would not be relevant anymore. But since we have not made a decision yet, I will leave it open for now.

@jsamr jsamr added the pr:review needed This PR requires review from maintainers. label Jul 5, 2020
Copy link
Collaborator

@jsamr jsamr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will merge this PR for the next 4.X version; just see my comments and I suggest your rebase!

@@ -16,13 +16,13 @@
"buffer": "^4.5.1",
"events": "^1.1.0",
"html-entities": "^1.2.0",
"htmlparser2": "^3.10.1",
"react-native-webview": "^5.6.0"
"htmlparser2": "^3.10.1"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should discard changes on package.json!

@@ -208,6 +208,9 @@ function cssToRNStyle (css, styleset, { emSize, ptSize, ignoredStyles, allowedSt
if (key === 'fontSize') {
return mapAbsoluteFontSize(key, value);
}
if (key === 'display' && ['flex', 'none'].indexOf(value) === -1) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jsamr jsamr added is:waiting for feedback Waiting for OP input. pr:fix Any code submission that repairs something broken. and removed pr:review needed This PR requires review from maintainers. labels Jul 10, 2020
@jsamr
Copy link
Collaborator

jsamr commented Jul 17, 2020

This PR has been manually merged to a fix branch which will be soon merged to master. See 3d62f2c

@jsamr jsamr closed this Jul 17, 2020
@jsamr jsamr removed the is:waiting for feedback Waiting for OP input. label Jul 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:fix Any code submission that repairs something broken.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid YGDisplay 'inline-block'
2 participants