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

Question: How to prevent node from being dropped before another node at top level?

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

Description

Is it possible to prevent node from being dropped before specific node at top level? This is possible for non-top level node since `nextParent` with latest state of children will be passed to `canDrop` callback. For top level node, `nextParent` is null and I can't figure way to get latest state of tree. Without latest state of tree, how can I tell in front of which node it's being dropped?

Example (How to prevent PF 1 and PF 2 from being dropped before SF 1 & SF 2?)

SF 1
--SF 1.1
----SF 1.1.1
SF 2
--SF 2.1
PF 1
PF 2

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.