How to stop touch event propagation in React-Native

前端 未结 5 1127
南笙
南笙 2021-02-05 09:12

I have a scrollview with a grid of images when I long press on an image I’d like to stop propagating the mouse events to the scrollview and just monitor the movements. With the

5条回答
  •  野的像风
    2021-02-05 09:58

    This would be the simplest answer:

    use this on the inner view at the point where you want the propagation to stop

    onTouchEnd={(e) => {
       e.stopPropagation()
    }}
    

提交回复
热议问题