Skip to content

Commit

Permalink
Clarify documentation for ScrollView component
Browse files Browse the repository at this point in the history
Summary:
The documentation for the prop `scrollEnabled` on the `ScrollView` component does not clarify that scrolling is still possible by calling `scrollTo` on the view ref.

Please see [this expo snack demo](https://snack.expo.io/BJKTVMM-Z) showing scrolling is allowed while `scrollEnabled` is `false`.

This PR makes the documentation for this prop more clear, in that setting it to false will only disable scrolling by touches, not universally.

In my opinion, this also raises the question of a need for an additional prop which would disable all scrolling, even when calling `scrollTo`.

I have attached a screenshot of what this part of the documentation looks like with my edit:

![screen shot 2017-05-23 at 3 38 59 pm](https://cloud.githubusercontent.com/assets/4976096/26374045/e73a035e-3fd1-11e7-93cd-3617c4ac4db8.png)
Closes #14140

Differential Revision: D5138593

Pulled By: shergin

fbshipit-source-id: db1a5f9c8ac41ecfce952e7b1fce9428b2068162
  • Loading branch information
chrisknepper authored and facebook-github-bot committed May 26, 2017
1 parent 6be550d commit cc1a4b0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Libraries/Components/ScrollView/ScrollView.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,10 @@ const ScrollView = React.createClass({
*/
pagingEnabled: PropTypes.bool,
/**
* When false, the content does not scroll.
* When false, the view cannot be scrolled via touch interaction.
* The default value is true.
*
* Note that the view can be always be scrolled by calling `scrollTo`.
*/
scrollEnabled: PropTypes.bool,
/**
Expand Down

0 comments on commit cc1a4b0

Please sign in to comment.