Skip to content

Commit

Permalink
docs(Tree): fix a keyboard navigation issue in tree stories
Browse files Browse the repository at this point in the history
if `title` is set on `Item`, the default getItemCollection method assumes the item's children contain child nodes, and sets hasChildNodes to `true`.
  • Loading branch information
alirezamirian committed Dec 12, 2024
1 parent f50ccab commit 3c7ffdf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/jui/src/Tree/Tree.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ export const Dynamic: StoryFn = () => {
onSelectionChange={setSelectedKeys}
>
{(item) => (
<Item key={item.name} title={item.name} childItems={item.children}>
<Item
key={item.name}
title={item.children ? item.name : undefined}
childItems={item.children}
>
{item.name}
</Item>
)}
Expand Down

0 comments on commit 3c7ffdf

Please sign in to comment.