Giter VIP home page Giter VIP logo

Comments (3)

SimonErich avatar SimonErich commented on June 4, 2024

Hey @naveed1239 ,
can you please try whether setting the captureEvent prop to true works?
Generally, it is quite complicated to handle the gestures in subviews, because there could be a conflict with it.

from react-native-zoomable-view.

naveed1239 avatar naveed1239 commented on June 4, 2024

Hey @naveed1239 ,
can you please try whether setting the captureEvent prop to true works?
Generally, it is quite complicated to handle the gestures in subviews, because there could be a conflict with it.

I have already set the "captureEvent" prop to "true" but it's not working. If i am putting the pdf or html views outside the "ReactNativeZoomableView" user able to scroll it smoothly but when I put it inside "ReactNativeZoomableView" user not able to scroll it smoothly. Below is my code
<ReactNativeZoomableView
maxZoom={maxZoomValue}
minZoom={minZoomValue}
zoomStep={zoomingValue}
initialZoom={zoom}
zoomEnabled={zoomEnabled}
bindToBorders
captureEvent={true}
onZoomEnd={(
event: any,
gestureState: any,
zoomableViewEventObject: { lastZoomLevel: any; zoomLevel: any }
) => {
if (zoomableViewEventObject) {
setZoomPercentage(zoomableViewEventObject.zoomLevel);
}
}}

      style={{
        zIndex: -10,
      }}
    >
      {contentType === "Html" && (
        // <View testID="htmlContainer" style={{ flex: 1 }}>
        <TouchableWithoutFeedback
          style={{ width: "100%", height: "100%" }}
          onPress={showAndHideHeaderView}
        >
          <WebView
            source={{
              uri: `${BaseURL()}/${filePath}`,
            }}
            onHttpError={() => {
              DisplayAlertWithActions({
                title: MultiLanguageSupport.SometingWentWrong,
                message: MultiLanguageSupport.HtmlNotAvailable!,
                okAction: () => {},
              });
            }}
            onError={() => {
              errorLoadingContent(
                MultiLanguageSupport.HtmlNotAvailable!,
                "error_loading_html_page"
              );
            }}
            onLoad={() => {
              callAddToRecentlyView();
              addEventToFB("html_page_loaded");
            }}
            style={{
              flex: 1,
              zIndex: 10,
              elevation: 10,
            }}
          />
        </TouchableWithoutFeedback>
        // </View>
      )}

from react-native-zoomable-view.

SimonErich avatar SimonErich commented on June 4, 2024

Unfortunately I am not sure if this problem can be solved, because it's a gesture listener problem.
Both of our packages try to access them and steal them away from each other.

Maybe you can try with custom buttons or something.
Here are the details:
https://github.com/DuDigital/react-native-zoomable-view/releases/tag/v1.1.0

I will close this for now, because I think this is not a specific problem in this package.
If somebody has a solution for this. Please comment here. We would really appreciate it!

from react-native-zoomable-view.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.