Skip to content

Commit

Permalink
docs(TreeView): Update example with duplicate IDs (#1306)
Browse files Browse the repository at this point in the history
  • Loading branch information
silvalaura authored Jun 4, 2024
1 parent 41c4548 commit 4747977
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/treeview-docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"react-magma-docs": patch
---

docs(TreeView): Update example with duplicate IDs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ export interface UseTreeItemProps extends React.HTMLAttributes<HTMLLIElement> {
*/
itemDepth?: number;
/**
* TODO: improve functionality (issue #1305)
* @internal
* If true, element is disabled
* @default false
*/
Expand Down Expand Up @@ -146,7 +148,7 @@ export function useTreeItem(props: UseTreeItemProps, forwardedRef) {
(child: React.ReactElement<any>) => child.type === TreeItem
);

// TODO fix for disabled items
// TODO fix for disabled items (issue #1305)
// const numberOfTreeItemChildren = getEnabledTreeItemChildrenLength(treeItemChildren);
const numberOfTreeItemChildren = treeItemChildren.length;
const hasOwnTreeItems = numberOfTreeItemChildren > 0;
Expand Down
2 changes: 1 addition & 1 deletion website/react-magma-docs/src/pages/api/tree-view.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function Example() {
>
<TreeItem
label={<>Art History in the 21st Century</>}
itemId="I-intro"
itemId="I-21st-century"
>
<TreeItem
label={<>The Questions Art Historians Ask</>}
Expand Down

2 comments on commit 4747977

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.