react-tree-list icon indicating copy to clipboard operation
react-tree-list copied to clipboard

feature request: parent has no parentDropZoneAfter

Open Vanillabacke opened this issue 5 years ago • 1 comments

Hallo again :D

It would be nice to have a dropZone at the end of each parent node.

The problem is, if you want to drop the node after a sibling with opened children, you won't be able to drop it right after. The dragged node will be moved as an child of the sibling.

For achieving the result, you have to close the sibling with children at first and then you can drop it after it without getting a childrin of the sibling.

Vanillabacke avatar Nov 07 '20 16:11 Vanillabacke

Hi @bartaxyz, I was playing around a bit and I implemented this enhancement.

Sadly I just started with typescript and I have a problem with passing in a function onDragOver in ReactTreeList.tsx on the part with the children around line 185:

if (parentOpen) {
        children.push(
          <ReactTreeListItem
            ...
            onDragging={(drag) => { ... }
            onDragOver={  /* logic goes here ... */ } // adding this line, will cause an error
            ...
          />
        );
      }

It looks like, that I have to define the type somewhere, but I couldn't figured it out. Maybe you have an idea? I would pull the source code, but I have no permissions to do that.

Vanillabacke avatar Nov 09 '20 15:11 Vanillabacke