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

Broken Playground examples

Open downright-development opened this issue 7 months ago • 1 comments
trafficstars

Describe the bug Using the default playground provided here - https://codesandbox.io/p/sandbox/react-complex-tree-playground-u5tjs

you can lose access to items by dragging folders under pages.

To Reproduce Expand the "Desserts" option. Drag Cookie to the root level. Drag anything under cookie

Expected behavior Cookie is a leaf node - nothing should be draggable under it.

Screenshots

https://github.com/user-attachments/assets/3bfbe8b8-7d37-407f-b981-80754a6cab5d

Additional context Can reproduce in playground directly

downright-development avatar Apr 06 '25 01:04 downright-development

You need to set the prop canDropOnNonFolder to false to get the desired behavior.

People can set this to true to implement special behavior for items being dropped on items that are not considered folders, but if you want to allow drag events only on items that can expand, which are named folders in the terminology of RCT, this needs to be set to false.

lukasbach avatar Apr 09 '25 20:04 lukasbach