Permalink
Browse files

Fix scalesPageToFit default property for iOS WebView.

Summary:
`scalesPageToFit`'s [documented default value is true](https://github.com/facebook/react-native/blob/master/Libraries/Components/WebView/WebView.ios.js#L318), but it's not explicitly set anywhere on iOS. On Android it's [set to true in defaultProps](https://github.com/facebook/react-native/blob/master/Libraries/Components/WebView/WebView.android.js#L203). This pull-request add the default behaviour.

```
import { WebView } from 'react-native;
/* ... */
<WebView source={{ uri: 'https://google.com' }} />
```

You should be able to zoom in and out using the pinch gesture.

1. Does the reviewer have any additional thoughts around the rest of the defaultProps which aren't explicitly set?
2. Does the reviewer have any additional thoughts on how these two components (iOS/ Android) can share more code?
Closes #14363

Differential Revision: D5345883

Pulled By: shergin

fbshipit-source-id: e7b9b89f13d6adcdc705244871e00b7a5da52c64
  • Loading branch information...
peterp authored and facebook-github-bot committed Jun 29, 2017
1 parent 16747dd commit 185948604c1bd58abe8db3632a78d768268b1cc4
Showing with 4 additions and 0 deletions.
  1. +4 −0 Libraries/Components/WebView/WebView.ios.js
@@ -367,6 +367,10 @@ class WebView extends React.Component {
]),
};
static defaultProps = {
scalesPageToFit: true,
};
state = {
viewState: WebViewState.IDLE,
lastErrorEvent: (null: ?ErrorEvent),

0 comments on commit 1859486

Please sign in to comment.