From e9c915a5c4939d1fc6e92ef8259264cdc0a38c61 Mon Sep 17 00:00:00 2001 From: Laura Silva <91160746+silvalaura@users.noreply.github.com> Date: Tue, 4 Jun 2024 15:04:17 -0400 Subject: [PATCH] docs(TreeView): Update example with duplicate IDs (#1306) --- .changeset/treeview-docs.md | 5 +++++ .../react-magma-dom/src/components/TreeView/useTreeItem.ts | 4 +++- website/react-magma-docs/src/pages/api/tree-view.mdx | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 .changeset/treeview-docs.md diff --git a/.changeset/treeview-docs.md b/.changeset/treeview-docs.md new file mode 100644 index 000000000..78bceb0cc --- /dev/null +++ b/.changeset/treeview-docs.md @@ -0,0 +1,5 @@ +--- +"react-magma-docs": patch +--- + +docs(TreeView): Update example with duplicate IDs \ No newline at end of file diff --git a/packages/react-magma-dom/src/components/TreeView/useTreeItem.ts b/packages/react-magma-dom/src/components/TreeView/useTreeItem.ts index c6b1fa2a9..5c80323c0 100644 --- a/packages/react-magma-dom/src/components/TreeView/useTreeItem.ts +++ b/packages/react-magma-dom/src/components/TreeView/useTreeItem.ts @@ -74,6 +74,8 @@ export interface UseTreeItemProps extends React.HTMLAttributes { */ itemDepth?: number; /** + * TODO: improve functionality (issue #1305) + * @internal * If true, element is disabled * @default false */ @@ -146,7 +148,7 @@ export function useTreeItem(props: UseTreeItemProps, forwardedRef) { (child: React.ReactElement) => 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; diff --git a/website/react-magma-docs/src/pages/api/tree-view.mdx b/website/react-magma-docs/src/pages/api/tree-view.mdx index dc199feb8..fd3343a6a 100644 --- a/website/react-magma-docs/src/pages/api/tree-view.mdx +++ b/website/react-magma-docs/src/pages/api/tree-view.mdx @@ -33,7 +33,7 @@ export function Example() { > Art History in the 21st Century} - itemId="I-intro" + itemId="I-21st-century" > The Questions Art Historians Ask}