Comments (1)
Here is the example usage of the API suggested in the pull request
const isCombineAllowedForItem = (combineWith: DraggableDescriptor) => {
const treeItem = tree.items[combineWith.id];
return treeItem && treeItem.data && treeItem.data.item.isCluster;
}
return (
<Tree
tree={tree}
isNestingEnabled={true}
isDragEnabled={true}
offsetPerLevel={22}
renderItem={renderItem}
onExpand={onExpand}
onCollapse={onCollapse}
onDragEnd={onDragEnd}
onDestinationChange={onDestinationChange}
isCombineAllowedForItem={isCombineAllowedForItem}
/>
)
since we have the whole tree that have all items already indexed in the .items field we can easily get and check conditions on per Item level
from dnd.
Related Issues (20)
- How to simulate Drag and Drop with JavaScript? HOT 1
- Laggy drop behaviour on NextJS 13 (App dir) HOT 3
- DND on table - React 18, NextJs, hello-pangea 16.3
- DND not firing the OnDragEnd function HOT 3
- No drag cursor on first render HOT 1
- Keep draggable in the home list when cloned HOT 4
- Migrate from CircleCI to GitHub Actions
- App could not compile due to optional chaining HOT 4
- Inplace placeholder HOT 3
- Wrong behaivoir droppable HOT 1
- Support redux 5 HOT 6
- Allow to skip dragging on specified elements
- How do I handle elements that wrap lines? HOT 2
- Disable the keyboard for drag and drop
- Usage with React Flow
- Draggable item not displaying properly when dragging
- Animate re-ordering of items during state change
- Shadow DOM support HOT 1
- Constraining movement axis? - Browser tabs
- Buggy horizontal reorder HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dnd.