Skip to content

Commit a303015

Browse files
committed
[fix ptmt#56] propagate frame property to WebView
1 parent 7b41ead commit a303015

File tree

4 files changed

+7
-48
lines changed

4 files changed

+7
-48
lines changed

Examples/UIExplorer/WebViewExample.js

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -178,43 +178,6 @@ var Button = React.createClass({
178178
}
179179
});
180180

181-
var ScaledWebView = React.createClass({
182-
183-
getInitialState: function() {
184-
return {
185-
scalingEnabled: true,
186-
}
187-
},
188-
189-
render: function() {
190-
return (
191-
<View>
192-
<WebView
193-
style={{
194-
backgroundColor: BGWASH,
195-
height: 200,
196-
}}
197-
source={{uri: 'https://facebook.github.io/react/'}}
198-
scalesPageToFit={this.state.scalingEnabled}
199-
/>
200-
<View style={styles.buttons}>
201-
{ this.state.scalingEnabled ?
202-
<Button
203-
text="Scaling:ON"
204-
enabled={true}
205-
onPress={() => this.setState({scalingEnabled: false})}
206-
/> :
207-
<Button
208-
text="Scaling:OFF"
209-
enabled={true}
210-
onPress={() => this.setState({scalingEnabled: true})}
211-
/> }
212-
</View>
213-
</View>
214-
);
215-
},
216-
})
217-
218181
var styles = StyleSheet.create({
219182
container: {
220183
flex: 1,
@@ -337,10 +300,6 @@ exports.examples = [
337300
title: 'Simple Browser',
338301
render(): ReactElement { return <WebViewExample />; }
339302
},
340-
{
341-
title: 'Scale Page to Fit',
342-
render(): ReactElement { return <ScaledWebView/>; }
343-
},
344303
{
345304
title: 'Bundled HTML',
346305
render(): ReactElement {

React/Views/RCTWebView.m

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ - (void)reload
7575
[_webView reload:self];
7676
}
7777

78+
- (void)reactSetFrame:(CGRect)frame
79+
{
80+
[super reactSetFrame:frame];
81+
[_webView setFrame:frame];
82+
}
83+
7884
- (void)setSource:(NSDictionary *)source
7985
{
8086
if (![_source isEqualToDictionary:source]) {
@@ -122,11 +128,6 @@ - (void)setContentInset:(NSEdgeInsets)contentInset
122128
// updateOffset:NO];
123129
}
124130

125-
- (void)setScalesPageToFit:(BOOL)scalesPageToFit
126-
{
127-
NSLog(@"setScalesPageToFit is not implemented");
128-
}
129-
130131
- (BOOL)scalesPageToFit
131132
{
132133
return YES;

React/Views/RCTWebViewManager.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ - (NSView *)view
3737
RCT_REMAP_VIEW_PROPERTY(bounces, _webView.scrollView.bounces, BOOL)
3838
RCT_REMAP_VIEW_PROPERTY(scrollEnabled, _webView.scrollView.scrollEnabled, BOOL)
3939
RCT_REMAP_VIEW_PROPERTY(decelerationRate, _webView.scrollView.decelerationRate, CGFloat)
40-
RCT_EXPORT_VIEW_PROPERTY(scalesPageToFit, BOOL)
4140
RCT_EXPORT_VIEW_PROPERTY(injectedJavaScript, NSString)
4241
RCT_EXPORT_VIEW_PROPERTY(contentInset, UIEdgeInsets)
4342
RCT_EXPORT_VIEW_PROPERTY(automaticallyAdjustContentInsets, BOOL)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-desktop",
3-
"version": "0.5.5",
3+
"version": "0.5.6",
44
"description": "A framework for building native desktop apps using React",
55
"license": "BSD-3-Clause",
66
"repository": {

0 commit comments

Comments
 (0)