[fix] ScrollView to use 'touch-action' to disable scroll

The recommendation from the Chrome team is to use 'touch-action' to
disable scrolling (via touch modality) when passive event listeners are
in use.

Close #563
This commit is contained in:
Nicolas Gallagher
2017-07-13 17:10:38 -07:00
parent 3677f0dd57
commit faec2b4a83
4 changed files with 40 additions and 38 deletions
@@ -5,7 +5,7 @@
*/
import React, { PureComponent } from 'react';
import { Button, ScrollView, StyleSheet, Text, View } from 'react-native';
import { Button, ScrollView, StyleSheet, Text, TouchableHighlight, View } from 'react-native';
export default class ScrollToExample extends PureComponent {
render() {
@@ -20,11 +20,15 @@ export default class ScrollToExample extends PureComponent {
style={styles.scrollViewStyle}
>
{Array.from({ length: 50 }).map((item, i) =>
<View key={i} style={[styles.box, styles.horizontalBox]}>
<TouchableHighlight
key={i}
onPress={() => {}}
style={[styles.box, styles.horizontalBox]}
>
<Text>
{i}
</Text>
</View>
</TouchableHighlight>
)}
</ScrollView>
<Button
@@ -671,6 +671,11 @@ const stylePropTypes = [
name: 'shadowRadius',
typeInfo: 'number | string'
},
{
label: 'web',
name: 'touchAction',
typeInfo: 'string'
},
{
name: 'top',
typeInfo: 'number | string'