v3.16.0
Features
- Added a
filteredCountgetter to the tree API, reporting how many nodes match the currentsearchTermacross the whole tree (regardless of which folders are open), or 0 when there is no active search. Consumers can now render a match count or a "no results" message viaisFiltered && filteredCount === 0instead of inspectingvisibleNodes(issues #112 and #256). (#383)
Fixes
- The default
searchMatchno longer searches a node's children. It previously stringified every value of the node's data, thechildrenarray included, so each ancestor of a match counted as a match itself, and terms likeidornamematched every folder by hitting keys nested in the children data. The filtered list is unchanged — parents of a match are still shown to keep the tree's structure — buttree.filteredCountnow reports real matches. (#383)
v3.15.1
Fixes
- Fixed the drag destination (
willReceiveDrop,dragDestinationParent) reporting a parent the cursor forbids. The hover handlers recorded a destination on every hover — even wherecanDrop()was false — so dragging a folder toward its own subtree left the reported parent pointing at that folder while the cursor said "no drop." The consumer-facing destination and the cursor are now both gated oncanDrop()and stay consistent; releasing over an invalid spot is still rejected rather than falling back to a root drop (the parentId half of issue #247). (#382)
v3.15.0
Features
- Added an
adjustMoveIndexhelper for customonMovehandlers.onMove'sindexis a pre-removal slot (it counts the destination rows as displayed, with the dragged rows still in place), which trips up handlers that splice the dragged rows out before inserting them — dragging a row just below itself would jump it past its neighbor.adjustMoveIndex({ index, dragIds, siblingIds })returns the index to insert at after removal.SimpleTree/useSimpleTreeare unaffected; they already insert before removing (issue #247). (#381)
v3.14.0
Features
- Dragging into the gap between an open folder and its first child now supports a
horizontal slide, matching how items and closed folders already behave. Sliding
right still drops the node as the folder's first child (the previous behavior);
sliding left drops it as a sibling — or grandsibling — of the folder, bounded by
the folder's ancestor chain.
computeDroppreviously hard-coded this gap to "first child," so the level was pinned and the slide never engaged (issue #330). (#378)
v3.13.2
Fixes
- Inputs rendered inside the tree (e.g. an
<input>in a modal) can now receive Space characters again. The tree's keyboard handler no longer intercepts keystrokes that originate from a nested form field or contenteditable element. (#377)
v3.13.1
Fixes
-
NodeApiaction methods (toggle,select,activate,focus,edit, etc.) are now bound to the node, so passing them as callbacks — e.g.<Toggle onClick={node.toggle} />— no longer throws "Cannot read properties of undefined (reading 'tree')" when invoked detached. (#374)
v3.13.0
Features
-
useSimpleTreenow accepts anonChangeoption, called with the full data array after any internal move/create/rename/delete — a single place to persist the whole tree without wiring up each handler yourself. (#373)
v3.12.0
Features
- Added a
disableDeselectOnClickprop. By default, clicking the empty area below the rows clears the selection; setting this prop keeps the current selection intact instead (#245, #308). (#369)
v3.11.0
Features
-
TreeApinow exposesscrollToOffset(offset)to scroll the list to an exact pixel offset from the top, and ascrollOffsetgetter to read the current position — the offset-based counterpart toscrollTo(id), useful for saving and restoring scroll position (#194). (#368)
v3.10.6
Fixes
-
scrollTo(and theselectionprop /tree.scrollTo()paths that use it) now scrolls horizontally as well as vertically, bringing a deeply nested node's indented content into view when rows overflow the tree's width. Previously only the vertical position was adjusted, leaving deep nodes off-screen to the right. (#367)