-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Allows translucent backgrounds to be applied to WebViews + adds props for disabling scrolling #767
Conversation
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 - and if you have received this in error or have any questions, please drop us a line at [email protected]. Thanks! |
Signed the CLA. |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
Why not just "backgroundColor"? Also, I feel like the "opaque" attribute is an implementation detail that we should hide. For example, we could set it automatically based on the opacity of the color specified. |
I really have no preferences as to how it's implemented :P I just did it the way it makes sense to me. I used underlayColor so that it isn't confused with the backgroundColor style attribute. |
I'm a little unclear about why backgroundColor is distinct from underlayColor? Why would you ever want them to be different? |
@nicklockwood Yeah I regret changing that. I see now also that I agree with your initial comment: hiding the |
- Enable/disable scrolling through `allowScroll` - Enable/disable scroll bouncing through `allowBounce` - Automatically adjust WebView's opacity based on backgroundColor - Default WebView backgroundColor to white to account for the opacity changes
opaque
and underlayColor
to WebView.
Changes discussed above have been made. Also added props for disabling scrolling and/or scroll bounce. |
@@ -213,6 +217,8 @@ var RCTWebView = createReactIOSNativeComponentClass({ | |||
validAttributes: merge(ReactIOSViewAttributes.UIView, { | |||
url: true, | |||
html: true, | |||
allowBounce: true, |
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.
can you use the same name as <ScrollView>
component? I think it's just bounces
and scrollEnabled
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.
Yup!
Looks good to me after the change, thanks for using backgroundColor, it's much more logical that way |
Enables overwriting of underlying colors for WebViews. Especially useful if you want to give your WebView a transparent background.