react-component / react-component/tree

Cannot drag a node into an empty folder

Open
#508 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.3k
Forks
490
Avg merge
3d 17h
Merged PRs (30d)
5

Description

In the demos, if you drag all the nodes out of a folder, you cannot drag anything back into the folder anymore (since the folder turns to a leaf node).

In other words, it seems the dropPosition is never 0 for leaf nodes? How can I drag a node into an empy folder?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the demos' drag-and-drop handling and trace how dropPosition is calculated for leaf nodes. Reproduce the case where all nodes are dragged out of a folder, then make an empty folder accept a dragged node and verify that the behavior works in the demos.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.