Version 3.0.0
Whats Changed?
Breaking Changes
- Tree Component
disableDrop
Prop Changed - NodeApi
isDroppable
Property Removed
Features
- Disable Edit
- Disable Drop Dynamically
Extras
- Indent Lines in Cities Demo
- Cypress Integration Tests
- Removed ForwardRef Redeclare
Features
Disable Edit
The disableEdit
prop was added to the tree to specify nodes that cannot be edited. This also fixed a bug when pressing the keyboard shortcut "Enter" on a node that did not render a form. The tree would get stuck in the "editing" mode and could not return to the normal mode.
Disable Drop Dynamically
The disableDrop
prop now accepts a function with the arguments described below. Previously you could only provide a static list of nodes that were not droppable, but now you can determine it dynamically.
Breaking Changes
Tree Component disableDrop
Prop
If you were passing a function to the disableDrop
prop, you'll need to update it to use the following signature:
declare function disableDrop(args: {
dragNodes: NodeApi[]; // The nodes being dragged
parentNode: NodeApi; // The new parent of the dragNodes if dropped
index: number; // The new child index of the dragNodes if dropped
}): boolean;
This lets you disallow a drop based on the items being dragged and which node you are hovering over. You might notice it matches the function signature of the onMove handler. It is still possible to pass a string or a boolean to the disableDrop
prop to prevent drops statically.
NodeApi isDroppable
property
The .isDroppable
property has been removed from the NodeApi class. This is now determined dynamically from the tree's state. It doesn't make sense to ask an single node if it is droppable anymore.
Pull Requests
- Add vscode-style structure lines for the cities demo by @percy507 in #94
- Disable edit by @danielnilsson9 in #97
- disabledDrop and target/source drop monitoring #62 by @rmeschian in #98
- Remove forwardRef declare by @jameskerr in #99
- Disable Drop Update by @jameskerr in #100
- Prepare Release v3.0.0 by @jameskerr in #101
- Update Changelog by @jameskerr in #102
New Contributors
- @percy507 made their first contribution in #94
- @danielnilsson9 made their first contribution in #97
- @rmeschian made their first contribution in #98
Full Changelog: v2.3.0...v3.0.0