openspacelabs / react-native-zoomable-view

A view component for react-native with pinch to zoom, tap to move and double tap to zoom capability.
MIT License
191 stars 58 forks source link

Touch propagation issue #16

Closed ghost closed 2 years ago

ghost commented 2 years ago

Hi there!

Great package, works as expected.

There's one issue though, I have SVG nested inside the zoomable as shown in the code below, When child(svg circle) is touched, is not propagated to parent view(zoomable).

For example: When I drag on SVG to left or right when the whole thing is zoomed, it doesn't drag.

PS: The drag action works properly, when it is done outside of svg.. I believe the above issue is because of onPress handler on SVG circle, if I remove that drag works normally.

<ReactNativeZoomableView
        maxZoom={2}
        minZoom={1}
        zoomStep={0.5}
        initialZoom={1}
        style={{
          padding: 10,
          backgroundColor: 'black',
        }}
        onTransform={e => console.log(e)}>
        <Svg> 
            <G transform={`translate(${leaf.x + 1},${leaf.y + 1})`}>
              <Circle
                    r={leaf.r}
                    fill={leaf.data.color}
                    onPress={() => console.log('test')}
               />
         </Svg>
      </ReactNativeZoomableView>
felixchan commented 2 years ago

Hi ghost, could you kindly share how you fixed this issue?

esadkrs commented 2 years ago

@felixchan, apparently @ghost gained access to the OP's account after it was deleted. Hence, no reason to expect an answer from him/her.

for ref. see the SS,

Screen Shot 2022-05-04 at 3 48 40 PM
maartenvandillen commented 1 year ago

Hi @felixchan did you manage to fix this?