garblovians / react-native-svg-pan-zoom

Pan-zoom via two-finger "Google Maps"-style pinch and drag gestures
MIT License
26 stars 23 forks source link

On iOS the PanResponder doesn't detect touch events on the SVG image. It works on the area outside. #6

Open adam-s opened 6 years ago

adam-s commented 6 years ago

On iOS if I move my figures around quickly it will stop the pan and zoom when touching the SVG image and paths, however, the background area will still be responsive.

pan_zoom

felixmagnell commented 6 years ago

@adam-s This is the behavior i'm trying to explain in my other issue. I get this when i click on one of the SVG elements.

adam-s commented 6 years ago

Current attempt at a solution:

      onPanResponderGrant: (evt) => {
        // Set self for filtering events from other PanResponderTarges
        if (evt.target !== this.prTargetSelf || evt.target !== this.prTargetOuter) {
          if (this.prTargetOuter == null) { this.prTargetOuter = evt.currentTarget; }
          if (evt.target !== evt.currentTarget) { this.prTargetSelf = evt.target; }
        }
      },
felixmagnell commented 5 years ago

@adam-s Did you get it to work?

AdamGerthel commented 5 years ago

Have the same problem :/

brunof17 commented 4 years ago

Any solutions to this?

AdamGerthel commented 4 years ago

@brunof17 I never got it fixed and eventually decided to skip zoom in my use case.

anhvd-iKong commented 2 years ago

Current attempt at a solution:

      onPanResponderGrant: (evt) => {
        // Set self for filtering events from other PanResponderTarges
        if (evt.target !== this.prTargetSelf || evt.target !== this.prTargetOuter) {
          if (this.prTargetOuter == null) { this.prTargetOuter = evt.currentTarget; }
          if (evt.target !== evt.currentTarget) { this.prTargetSelf = evt.target; }
        }
      },

@adam-s Can you show the full code about this trick? Thank you.

FlavioScimeca commented 6 months ago

any news? i am stuck