react-native-web icon indicating copy to clipboard operation
react-native-web copied to clipboard

Scrollview inside a webview of react native project doesn't scroll

Open shraddha1704 opened this issue 10 years ago • 5 comments

Hello,

I have react native app in which I have to display a webview. The webview is created in another RN project using react-native-web module and consists of a scrollview component. I am able to scroll the webview on my desktop, but unable to scroll it on my mobile screen on user's touch. Does the touch event go to the webview? How am I supposed to make it scroll?

I have written the webview code below.

var array1 = ['1','2','3','4','5','6','7','8','9','10'];
var array2 = ['11','12','13','14','15','16','17','18','19','20'];
import List1 from './List1';

...
...

render() {
    return (
         <View style={{flex:1}} >
                <ScrollView 
                    style={{backgroundColor:'#f2f2f2', paddingBottom:12, flex:1}}
                    contentContainerStyle={styles.container}
              onScroll={(e)=>{this.onScroll(e)}}
                    onTouchMove={()=>{console.log('onTouchMove')}}
                    scrollEventThrottle={16}>
                    {
                    <View>
                        <Text style={styles.title}>
                          Array 1
                        </Text>
                        <View style={styles.container}>
                          {
                            this.state.array1.map((item,i) => {
                                return <List1 key={i} {...item}/>
                            })
                          }
                        </View>
                        <Text style={styles.title}>
                         Array 2
                        </Text>
                        <View style={styles.container}>
                          {
                            this.state.array2.map((item,i) => {
                                return <List1 key={i} {...item}/>
                            })
                          }
                        </View>
                    </View>
                    }
                </ScrollView>
            </View> 
    );
}

Regards, Shraddha

shraddha1704 avatar Jul 29 '16 10:07 shraddha1704

Thanks, this was caused by https://github.com/necolas/react-native-web/commit/6a9212df4004a40ec96000fa9bc17847db89cf51

Some stuff I've been reading...

necolas avatar Jul 29 '16 17:07 necolas

Please try [email protected]

necolas avatar Jul 29 '16 21:07 necolas

Thanks for the quick response. I'm unable to install the 0.0.40 version. The npm installation of this module version says that it is invalid.

shraddha1704 avatar Aug 03 '16 04:08 shraddha1704

I can't reproduce that.

necolas avatar Aug 03 '16 16:08 necolas

Thanks! It worked like a charm

shraddha1704 avatar Aug 04 '16 05:08 shraddha1704