2

This is Android specific problem in react native app.

To be more precise, this issue can be produced on Samsumg S6 Edge, Pixel 2 etc. and it works with other Android phones.

I have a webview (which plays video) wrapped under Touchable as shown below:

<TouchableOpacity style={{
                              width: deviceWidth,
                              height: 225
                          }} onPress={() => {
                              console.log("It works or not?")
                          }}>
                            <View onStartShouldSetResponder={() => true} style={styles.newsVideo}>
                              <WebView ref="videoView"
                                              scalesPageToFit={true}
                                              javaScriptEnabled={true}
                                              allowsInlineMediaPlayback={true}
                                              source={{uri: item.node.newsUrl + '&fs=1'}}
                              />
                            </View>
                          </TouchableOpacity>

When I click on webview, it wont recognize touch at all.

If I remove TouchableWithoutFeedback, it works jut fine.

I need to have touchable to get some data on its onPress event when clicked on webview.

Here is style for - styles.newsVideo

newsVideo: {
    overflow: 'hidden',
    alignSelf: 'center',
    width: deviceWidth,
    height: 225,
    borderRadius: 0,
    marginTop: 0,
    borderColor: 'transparent',
},

I have tried props like onStartShouldSetResponder, pointerEvents as suggested on other posts. none them is working for me. Really appreciate someone's help here. Thanks

Vishal
  • 21
  • 4

0 Answers0