Skip to main content

Changelog

2.0.2 12/31/2202

Bug Fixes and Improvements

  • Fixed a bug where dragging a node above the topmost node throws an error in the log (#203)
  • Fixed a bug where dragging an item onto itself would make it disappear from the tree (#205)

2.0.1 12/18/2022

Bug Fixes and Improvements

  • Fixed a bug where autofocus for the search input was not working for blueprintjs renderers (#197)
  • Fixed a bug where tree labels where not set (#195)
  • Reduce react peer dependency requirement to v16 (#196)

Other Changes

  • Upgraded storybook and yarn dependencies in dev tooling
  • Added release pipeline in CI

2.0.0 - 12/05/2022

Breaking Changes

  • Replaced item.hasChildren property with item.isFolder
  • Replaced environment.canDropOnItemWithChildren property with environment.canDropOnFolder
  • Replaced environment.canDropOnItemWithoutChildren property with environment.canDropOnNonFolder
  • Replaced CSS classes related to hasChildren with isFolder, e.g. rct-tree-item-li-hasChildren to rct-tree-item-li-isFolder

Note: These properties were just renamed, but the functionality is the same. hasChildren has always denoted whether an item is a folder or not, which confused a lot of people and was admittedly very bad naming. The new name is a better reflection of its functionality. The other two properties were renamed alongside to match.

Bug Fixes and Improvements

  • Upgraded library to React 18.
  • Improved how "select up to" (i.e. shift+clicking) works, to match how users would expect it to work. The user can now create multiple distinct selection ranges by clicking and shift-clicking another item, then control clicking a different item and shift+control clicking a forth item.
  • The function treeItemActions.selectUpTo() now accepts an optional boolean argument determining whether the previous selection range should be cleared before selecting the new range.
  • Removed unnecessary memoization for event handlers, favoring stable callbacks stored in refs instead.
  • Fixed a bug where renaming an item would make the page loose focus of the active tree.
  • Items can now be dropped on empty trees. The tree container will need to be rendered with a minimum height for this to work, in the default renderers the container will now render with a minimum height of 30px, which can be adjusted in custom renderers.
  • Fixed a bug where renaming from item renderer context was not working.

Other Changes

  • Added linter rules from airbnb config and fixed relevant issues. This fixed some memoization imperfections, which should improve performance.
  • (Finally) added integration tests. This will ease the future development and help reduce regressions.

Migration guide

  • Replace the hasChildren property for tree items with isFolder.
  • Replace the canDropOnItemWithChildren property on tree environment components or tree components with canDropOnFolder.
  • Replace the canDropOnItemWithoutChildren property on tree environment components or tree components with canDropOnNonFolder.
  • The upgrade of React to 18 should not require any changes on your end.
  • If you are using custom interaction managers and want to benefit from the improved "select up to" functionality, replace actions.selectUpTo() with actions.selectUpTo(!e.ctrlKey) in the onClick handler.
  • If you are overwriting CSS styles for rct-specific classes, replace hasChildren with isFolder in the class names.