Add scrollEnabled example to RNTester (#23409)

Summary:
RNTester is missing a test for the scrollEnabled prop

[General] [Added] - Added RNTester ScrollView scrollEnabled prop test
Pull Request resolved: https://github.com/facebook/react-native/pull/23409

Differential Revision: D14059824

Pulled By: hramos

fbshipit-source-id: 0287277b64aeac69c4aeba83dbb3f73be646ede7
This commit is contained in:
Brent Erickson
2019-02-12 17:25:44 -08:00
committed by Facebook Github Bot
parent 7a6fe0cda0
commit 08a6b573f7
2 changed files with 39 additions and 0 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 286 KiB

After

Width:  |  Height:  |  Size: 296 KiB

View File

@@ -126,6 +126,45 @@ exports.examples = [
);
},
},
{
title: '<ScrollView> enable & disable\n',
description: 'ScrollView scrolling behaviour can be disabled and enabled',
render: function() {
class EnableDisableList extends React.Component<{}, *> {
state = {
scrollEnabled: true,
};
render() {
return (
<View>
<ScrollView
automaticallyAdjustContentInsets={false}
style={styles.scrollView}
scrollEnabled={this.state.scrollEnabled}>
{THUMB_URLS.map(createThumbRow)}
</ScrollView>
<Text>
{'Scrolling enabled = ' + this.state.scrollEnabled.toString()}
</Text>
<Button
label="Disable Scrolling"
onPress={() => {
this.setState({scrollEnabled: false});
}}
/>
<Button
label="Enable Scrolling"
onPress={() => {
this.setState({scrollEnabled: true});
}}
/>
</View>
);
}
}
return <EnableDisableList />;
},
},
];
if (Platform.OS === 'ios') {
exports.examples.push({