·
4 commits
to main
since this release
Fixed
- General: Ensure pointerdown or click event handlers only execute when the main button is clicked
- Tree View: Exported
TreeViewNodeState
andTreeViewNodeProps
types from@zag-js/tree-view
Changed
-
Collection: Improve the APIs around
tree.flatten(...)
andflattenedToTree
to ensure the original node
properties are preserved.Previously,
tree.flatten()
would return an array of objects withvalue
andlabel
stripping out the original
node properties.const tree = new TreeCollection({ rootNode: { value: 'ROOT', children: [{ value: 'child1' }, { value: 'child2' }], }, }) const flattened = tree.flatten() const reconstructed = flattenedToTree(flattened) console.log(reconstructed.rootNode) // { // value: "ROOT", // children: [{ value: "child1" }, { value: "child2" }], // }