Changelog
2.4.4 - 18/05/2024
Features
- Introduce
disableArrowKeys
prop on tree environment to disable arrow-related hotkeys (#363)
2.4.3 - 30/04/2024
Features
- RTL mode can be used on default renderers, see docs for details (#369)
- Redirect focus to first item if focused item was dragged to hidden location (#362)
Bug Fixes and Improvements
- Fixes an issue where not providing a submit button ref in a custom rename input renderer would prevent dismissing the input on blur (#368)
- Fixes an issue where dropping an item on its children was possible through keyboard-based dragging (#363)
2.4.2 - 04/04/2024
Bug Fixes and Improvements
- Fixed an issue where sometimes the uncontrolled tree environment would throw undefined-access errors (#355)
2.4.1 - 27/03/2024
Bug Fixes and Improvements
- Fixed a bug where items where sometimes inserted with inverted order. (#353)
- The
onDrop
should be a bit faster in general, since some redundant calls todataProvider.onChangeItemChildren
have been removed. In the past, this was called twice per item, once for moving the item out of its old folder, and once for moving it into the target folder. Now, all insertion calls into the target folder are batched into onedataProvider.onChangeItemChildren
call for all dragged items.
- The
2.4.0 - 21/03/2024
Features
- Make drop target depth in last-of-subtree locations dependent on x-coordinates of the mouse, allowing the user to drop in higher depths than the currently hovering item. This behavior is automatically used if renderDepthOffset on the renderers is set to a non-zero value. (#148)
❤️ This development of this release was supported and sponsored by Modyfi. Thank you for contributing to the development of this library!
2.3.7 - 15/03/2024
Featureset revertion to the state of 2.3.6
I've noticed that I've accidentally been pushing a few experimental releases that were meant to be released as prerelease under the "Latest" tag in NPM. This reverts the latest release to the state of 2.3.6, the last proper "latest" release. Prereleases will from now on be released under the "prerelease" tag in NPM.
2.3.6 - 07/03/2024
Other Changes
- Add funding link to package.json
2.3.5 - 02/03/2024
Features
- Add
setDomFocus
argument to focus-item methods to provide an escape hatch to set the focus state of an item in RCT without updating the DOM focus. This defaults to true in all existing methods to maintain the current behavior if it is absent. (#336) - Allow customizing when a subtree is rendered or not with the new
shouldRenderChildren
prop. This can be used to create opening and closing animations on subtrees. See Demo and Demo Implementation for details. (#333)
Bug Fixes
- Fix a bug where the
parentId
property in therenderItemsContainer
render method was incorrectly set to the tree id for the root container.
2.3.4 - 18/01/2024
Other Changes
- Make the
onDidChangeTreeDataEmitter
prop on a static data provider public
2.3.3 - 18/01/2024
Bug Fixes and Improvements
- Maintain original item order when dropping items (#315)
- Expose some hooks and internally used components in the public API that were hidden before (#313)
2.3.2 - 05/12/2023
Bug Fixes and Improvements
- Improved the implementation of the
onSelectItems
prop to not run during a React update, which was causing issues in some cases (#278)
2.3.1 - 04/12/2023
Bug Fixes
- Items dropped at the bottom most position (outside of the rectangle of tree items, but still inside the tree container) will now be placed in the root item, at the final position, instead of the contents of the last open item (#261)
2.3.0 - 30/11/2023
Breaking Changes
- Changed the behavior for dropping an item at the bottom of an open folder has changed, and will now drop
into the open folder at its top, instead of the parent folder below the open folder. See discussion at #148 for details.
You can opt out of this behavior by setting the
canDropBelowOpenFolders
prop on the tree environment (#148).
Bug Fixes
- Fixed a bug where the
canRename
property in a tree item payload was not respected.
2.2.4 - 27/11/2023
Features
- Add a
expandSubsequently
method on the environment and tree refs, to facilitate searching through items that are not yet opened (#287). See https://rct.lukasbach.com/docs/guides/search#finding-items-that-are-not-loaded-in for details
2.2.3 - 24/10/2023
Bug Fixes and Improvements
- Fix Syntax Error in CSS styles (#288)
2.2.2 - 31/07/2023
Features
- Introduce
disableMultiselect
property on uncontrolled tree environment (#279)
Bug Fixes and Improvements
- Fixes a bug where a state property is updated when the component is unmounted (#278)
2.2.1 - 22/07/2023
2.2.0 - 14/06/2023
Features
- Added
stopRenamingItem()
function to item render context (#271)
Bug Fixes and Improvements
- Added check in
onMissingItems
in casedataProvider.getTreeItems
return null as tree value (#272) - Remove unused types
renderDraggingItem
andrenderDraggingItemTitle
- Don't use timeout to update linear items (#266)
2.1.5-alpha.0 - 20/05/2023
2.1.4 - 16/05/2023
2.1.4-alpha.0 - 02/05/2023
Bug Fixes and Improvements
- Fixed globally-scoped references to the document prop into a getter that doesn't fail in ssr environments (#259)
2.1.3 - 02/05/2023
Bug Fixes and Improvements
- Fixed a bug where dragging to an item and back to the original position would still drop the item on the temporary position (#249)
2.1.2 - 02/04/2023
Bug Fixes and Improvements
- Fixed a bug where the icon was misaligned when scrolling in the modern theme (#239)
2.1.1 - 27/02/2023
Bug Fixes and Improvements
- Fixes bug where dropping an item on its own descendant makes it vanish (#227)
2.1.0 - 24/02/2023
Bug Fixes and Improvements
- Dragging on a non-folder item with
canDropOnNonFolder=false
andcanReorderItems=false
will now target the item's parent. (#219)
2.0.4 - 05/02/2023
Bug Fixes and Improvements
- Fix: Previous release did not include the new css file.
2.0.3 02/04/2023
Features
- Introduced new tree theme. You can opt into the new theme by importing
style-modern.css
instead ofstyle.css
Other Changes
- Fixed broken props-tables documentations for react components.
- Fixed incomplete getstarted documentation page.
2.0.2 12/31/2022
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 withitem.isFolder
- Replaced
environment.canDropOnItemWithChildren
property withenvironment.canDropOnFolder
- Replaced
environment.canDropOnItemWithoutChildren
property withenvironment.canDropOnNonFolder
- Replaced CSS classes related to
hasChildren
withisFolder
, e.g.rct-tree-item-li-hasChildren
torct-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 withisFolder
. - Replace the
canDropOnItemWithChildren
property on tree environment components or tree components withcanDropOnFolder
. - Replace the
canDropOnItemWithoutChildren
property on tree environment components or tree components withcanDropOnNonFolder
. - 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()
withactions.selectUpTo(!e.ctrlKey)
in theonClick
handler. - If you are overwriting CSS styles for rct-specific classes, replace
hasChildren
withisFolder
in the class names.