Skip to content

Commit

Permalink
Implement 'bounces' prop
Browse files Browse the repository at this point in the history
Summary:
@public

The content that loads inside `WKWebView` renders within a `ScrollView`. Suppose the user pulls the page down when its top edge hits the top edge of the web view. Then, one of two things can happen as the user continues to pull the page down:
1. We let the page be pulled past the top edge of the web view.
1. We fix the page's vertical offset to 0 so that it doesn't move past the top edge of the web view.

The property that controls this behaviour is `<WKWebView bounces={true|false}/>`. In this diff, I implement it.

Reviewed By: mmmulani

Differential Revision: D6306866

fbshipit-source-id: 7763df78676215c3dd0bd7a029497a6eca1873ab
  • Loading branch information
RSNara authored and facebook-github-bot committed Aug 16, 2018
1 parent 7a6dd98 commit e5f95ab
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions React/Views/RCTWKWebViewManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ - (UIView *)view
}];
}

RCT_REMAP_VIEW_PROPERTY(bounces, _webView.scrollView.bounces, BOOL)

@end

0 comments on commit e5f95ab

Please sign in to comment.