frontend-collective / frontend-collective/react-sortable-tree

canDrop prop doesnt work when tree is empty

Open
#482 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5k
Forks
914
PR merge metrics
No merged PRs in 30d

Description

Hi,
The canDrop prop should still work when the tree is empty. As of right now if the tree is empty you can always drop something into it. If there is a condition where I don't want to be able to drop something into an empty tree then I should be able to use canDrop to set that.
Thanks,
Maria

I have set can drop of my tree to false:
![image](https://user-images.githubusercontent.com/28845265/58964338-b8f0e400-877c-11e9-9012-31c7a571208b.png)
I have 2 trees, the bottom tree which is empty right now has canDrop set to false:
![image](https://user-images.githubusercontent.com/28845265/58964371-c908c380-877c-11e9-9115-5bce9b96449b.png)
I am still able to drop something into it even though can drop is set to false:
![image](https://user-images.githubusercontent.com/28845265/58964395-d4f48580-877c-11e9-9410-21f016babc02.png)
The canDrop prop does not work when the tree is empty, you can always drop something into an empty tree. Once the tree is no longer empty the canDrop prop actually works and I am no longer able to drop something into the tree.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.