Skip to content

Real iOS device: Cannot scroll or click any link, button inside webview content #307

Description

@canhtran10
  • Platform: iOS 16.5 real device iPhone 13,14 (existing device)

  • ReactNative: 0.64

  • Webview Library: react-native-webview

  • Code:
    `
    <Modal
    width={1}
    height={1}
    visible={isModalVisible}
    rounded
    actionsBordered

      style={{ zIndex: 99 }}
      onTouchOutside={() => {
        setModalVisible(!isModalVisible);
      }}
      modalTitle={<ModalTitle title="" align="center" style={{ height: 0 }} />}
      footer={<View />}
    >
      <ModalContent
        style={{
          backgroundColor: '#fff',
          flex: 3,
          paddingVertical: 0,
          paddingHorizontal: 0,
        }}
      >
        <WebContentView>
          <WebView
            style={{
              width: Dimensions.get('window').width,
              zIndex: 200,
              marginTop: Platform.OS === 'ios' ? 25 : 10,
            }}
            ref={(ref) => (webviewPayment.current = ref)}
            originWhitelist={['*']}
            onNavigationStateChange={handleWebViewNavigationStateChange}
            source={{ uri: paymentUrl }}
            startInLoadingState={true}
            domStorageEnabled={true}
            automaticallyAdjustContentInsets={true}
            mixedContentMode={'always'}
            onScroll={(syntheticEvent) => {
              const { contentOffset } = syntheticEvent.nativeEvent;
            }}
            cacheEnabled={false}
            javaScriptEnabled={true}
            javaScriptCanOpenWindowsAutomatically={true}
            androidLayerType={'software'}
            scalesPageToFit={true}
            setSupportMultipleWindows={false}
            renderLoading={() => <Indicator loading={true} title={getString('common.Loading', language)} />}
          />
        </WebContentView>
      </ModalContent>
    </Modal>
    

`

  • Problem: I cannot click on any links or buttons inside the WebView. I have tried with various URLs, including google.com. However, there is no issue on the iOS simulator and Android, both on simulators and some real devices. I tried moving the WebView outside of the Modal, and it works fine.

Thanks

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions