jeremybarbet / react-native-modalize

A highly customizable modal/bottom sheet that loves scrolling content.
https://jeremybarbet.github.io/react-native-modalize
MIT License
2.84k stars 298 forks source link

swiping down to scoll to top in webview wrapped in modalize #473

Open mansoorameen opened 1 year ago

mansoorameen commented 1 year ago

Describe the bug: the problem is when i try to scroll up(swipe down) in the web page, the modalize closes(this is the expected behaviour of modalize i believe), but how do I turn off that and swipe down close enable only on the hanlder?

Steps to reproduce: run this code

     <Portal>
                                <Modalize ref={modalizeRef}
                                    onLayout={handleLayout}
                                    tapGestureEnabled={true}
                                >
                                    <WebView
                                        androidLayerType='software'
                                        ref={webViewRef}
                                        useWebKit={true}
                                        source={{ uri: openUrl }}
                                        style={{ height, opacity: 0.99 }}
                                    />
                                </Modalize>
                            </Portal>

Dependencies: "react-native-modalize": "^2.1.1", "react-native-portalize": "^1.0.7", "react-native-webview": "^11.26.0", "react-native-gesture-handler": "^2.8.0",

DmitryFt commented 10 months ago

Hi @mansoorameen , did you find any solution for this ?

mansoorameen commented 10 months ago

Hi @mansoorameen , did you find any solution for this ?

this fixed it for me

`
<Modalize

              ref={modalizeRef}

              onLayout={handleLayout}

              tapGestureEnabled={false}

              panGestureEnabled={false}

              scrollViewProps={{
                disableScrollViewPanResponder: false,
              }}

              modalStyle={{
                marginTop: globalStyles.deviceHeight * 0.1,
                marginBottom: -10,
              }}

            >

              <WebView

                ref={webViewRef}

                source={{ uri: openUrl }}

                style={{ height, opacity: 1, paddingBottom: 20 }}

                startInLoadingState={true}

              />

            </Modalize>

`