rete icon indicating copy to clipboard operation
rete copied to clipboard

Prevent dragging nodes and keep the ability to add connections

Open AnastasiaLL opened this issue 1 year ago • 1 comments

Hi, in my angular app I want to turn off dragging all nodes, but leave the ability for users to create connections between nodes. Here's my code:

area.addPipe(context => { if (context.type === 'rendered') { if (context.data.type === 'node') { context.data.element.addEventListener('pointerdown', event => event.stopPropagation()); } } return context})

What am I doing wrong? Thanks a lot!!

AnastasiaLL avatar Jan 18 '24 11:01 AnastasiaLL

dragging causes the node's position change, so nodetranslate can be prevented as it is done in the readonly plugin.

https://github.com/retejs/readonly-plugin/blob/main/src/index.ts#L39 https://discord.com/channels/1081223198055604244/1156215577023627387/1156268661317828651

Ni55aN avatar Feb 16 '24 19:02 Ni55aN

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 Mar 24 '24 01:03 rete-js[bot]

This issue was closed because it has been stalled for 10 days with no activity.

rete-js[bot] avatar Apr 07 '24 01:04 rete-js[bot]