ng2-dnd icon indicating copy to clipboard operation
ng2-dnd copied to clipboard

Dragging nested components

Open Nicholas-Westley opened this issue 8 years ago • 5 comments

[ ] bug report [x] feature request [ ] question about the decisions made in the repository

Are nested components supported? Can a dnd-sortable-container be a decendent of a dnd-sortable element? I have an item component that can contain its own list of items. The first level of items drag fine but any inner ones don't. Have I made a mistake or is this not supported?

  • Angular version: 2.3.0
  • Browser: all

Nicholas-Westley avatar Jan 03 '17 23:01 Nicholas-Westley

I got this working quite well in angular 1 - it's proving quite tricky using this library. If anyone makes some progress, please let me know!

geoffles avatar Jan 05 '17 07:01 geoffles

#20

geoffles avatar Jan 05 '17 07:01 geoffles

I know that this issue is old, but I managed to get something similar working by following the instructions in the example Multi list sortable between containers in the readme. Basically one have to use dropZones and enable/disable the dragging (dragEnabled) for the different groups selectively. In my implementation I'm using mouseenter to enable the dragging in the zone of the nested components while at the same time I'm disabling it for the container (and doing the opposite on mouseleave).

iignatov avatar Jun 01 '17 12:06 iignatov

@iignatov thanks for the info. Whilst important, I had more urgent things to work on, and hadn't yet come back to the DND on my project. I figured it would be something like that, just haven't had the time to try doing that since it's a whole bunch of PT. Thanks for comment though - will try that out.

geoffles avatar Jun 02 '17 06:06 geoffles

@iignatov Would you be able to provide more info on how you are setting dragEnabled to true on mouseenter? I suspect via a separate method?

fromage9747 avatar Oct 15 '18 11:10 fromage9747