-
-
Notifications
You must be signed in to change notification settings - Fork 600
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
Conversation
@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. |
There was a problem hiding this 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" |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR has been manually merged to a fix branch which will be soon merged to master. See 3d62f2c |
If an element has a display attribute that is not
flex
ornone
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!