Cannot stop event bubbling? #353
|
Hello. Everything works great except that the onDrag event gets registered both on my opened image and the gallery(as it can be navigated by dragging). Here is my code for the gestures: |
Replies: 1 comment 5 replies
|
I'm pretty sure the drag you're seeing on the image is the native drag and drop from the browser which you won't disable with Simplest solution would probably be to have the css But that's hard to assess without a sandbox: giving a minimal sandbox in your issues / questions simplifies answers drastically. Also, you can try upgrading to |
I'm pretty sure the drag you're seeing on the image is the native drag and drop from the browser which you won't disable with
stopPropagation. There's a few things you could do, like trying toevent.preventDefault()(but witheventOptions.captureset totrue).Simplest solution would probably be to have the css
pointer-events: noneon your image element.But that's hard to assess without a sandbox: giving a minimal sandbox in your issues / questions simplifies answers drastically.
Also, you can try upgrading to
@use-gesture/reactwhich will release shortly (in that case, make sure your renamedomTargettotarget.