rete icon indicating copy to clipboard operation
rete copied to clipboard

Turn off dragging on node when interacting with input controls.

Open Pitchlab opened this issue 3 years ago • 5 comments

I would like to enable users to interact with controls on a node, e.g. a slider, turn dial, or other controls. Currently, dragging on the control will make the node move.

I can turn off the dragging using e.g. e.stopPropagation() but then the control won't work either. Case in point: using <input type="range"/>

How can I make this happen? And would it not make more sense to have the controls be able to respond to their own mouse events without interference?

Current behavior: when on slider control (<input type="range"/>) the node drags, not the slider Expected behavior: when I drag the area on the node OUTSIDE controls, the node drags, when on the slider, I can manipulate the slider.

Any help welcome!

Pitchlab avatar Jul 17 '20 08:07 Pitchlab

@Pitchlab in what environment are you working in? So what is the framework you are using?

creadicted avatar Jul 17 '20 10:07 creadicted

I need to achieve the exact same behavior, something like detaching the controls area from the drag event

I'm using the Angular render plugin, but I guess this is something related to this library

a7md0 avatar Aug 06 '20 22:08 a7md0

I'm working on same issue. I try to make image crop operation on node but it's not possible :( Node always moving with cropper. I'm using Angular render plugin.

hasanaydemir avatar Aug 26 '20 21:08 hasanaydemir

I try something then it's worked for me. I'm using ngx-image-cropper on my project. Node stop dragging when I cropped image.

image-cropper is control class name, image-roi-select is node component class name. document.querySelector('.image-cropper').addEventListener('pointerdown', event => event.stopPropagation()) document.querySelector('.image-roi-select').addEventListener('pointerdown', event => event.defaultPrevented)

hasanaydemir avatar Aug 27 '20 08:08 hasanaydemir

Got the same issue. I wish there was a way to exclude some classes or selectors from the drag event.

ghost avatar Mar 10 '22 15:03 ghost

I try something then it's worked for me. I'm using ngx-image-cropper on my project. Node stop dragging when I cropped image.

image-cropper is control class name, image-roi-select is node component class name. document.querySelector('.image-cropper').addEventListener('pointerdown', event => event.stopPropagation()) document.querySelector('.image-roi-select').addEventListener('pointerdown', event => event.defaultPrevented)

I used this idea for my angular app. With angular I used HostListener for the events and it's working. We could also create a directive for this event to use on different components.

@HostListener('pointerdown', ["$event"]) mouseenter($event: MouseEvent) { $event.stopPropagation() }

@HostListener('pointerup', ["$event"]) mouseexit($event: MouseEvent) { $event.defaultPrevented; }

Plaximo avatar Jan 11 '23 10:01 Plaximo

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days.

rete-js[bot] avatar Jul 13 '23 10:07 rete-js[bot]