Skip to content

Commit

Permalink
refactor: treeview
Browse files Browse the repository at this point in the history
  • Loading branch information
segunadebayo committed Nov 9, 2024
1 parent aba6af0 commit da4bdce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/proud-numbers-cheer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@zag-js/tree-view": patch
---

Add `data-*` attributes to branch content
3 changes: 3 additions & 0 deletions packages/machines/tree-view/src/tree-view.connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,9 @@ export function connect<T extends PropTypes>(state: State, send: Send, normalize
role: "group",
dir: state.context.dir,
"data-state": nodeState.expanded ? "open" : "closed",
"data-depth": nodeState.depth,
"data-path": props.indexPath.join("/"),
"data-value": nodeState.value,
hidden: !nodeState.expanded,
})
},
Expand Down

0 comments on commit da4bdce

Please sign in to comment.