Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
canhtran10 opened this issue Jul 11, 2023 · 1 comment

Comments

@canhtran10
Copy link

canhtran10 commented Jul 11, 2023

  • 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

@canhtran10 canhtran10 changed the title Cannot scroll or click any link, button inside webview content Real iOS device: Cannot scroll or click any link, button inside webview content Jul 11, 2023
@canhtran10
Copy link
Author

canhtran10 commented Jul 29, 2023

just understand why this issue happened, I have created a simple modal and add Webview component to it, and it work perfect:
<ModalBody> {isWebview && children} {!isWebview && <ScrollView>{children}</ScrollView>} </ModalBody>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant