-
-
Notifications
You must be signed in to change notification settings - Fork 95
Closed
Description
Describe the bug
The aria-label
of the role="tree"
element does not get set to the treeLabel
property of a Tree
component since the property is not passed on to the treeInformation
object.
To Reproduce
Steps to reproduce the behavior:
- Pick any example that uses the
treeLabel
property, for example https://rct.lukasbach.com/docs/guides/search - Use the accessibility view in Chrome dev tools to view the accessibility tree.
- See that the label is empty (
""
)
Expected behavior
The label should be assigned (via aria-label
attribute).
Additional context
Related code:
react-complex-tree/packages/core/src/tree/Tree.tsx
Lines 48 to 75 in 90d24f6
const treeContextProps = useMemo<TreeContextProps>( | |
() => ({ | |
treeId: props.treeId, | |
rootItem: props.rootItem, | |
treeLabel: props.treeLabel, | |
treeLabelledBy: props.treeLabelledBy, | |
getItemsLinearly: () => | |
getItemsLinearly(props.rootItem, viewState ?? {}, environment.items), | |
treeInformation, | |
search, | |
setSearch, | |
renamingItem, | |
setRenamingItem, | |
renderers, | |
}), | |
[ | |
environment.items, | |
props.rootItem, | |
props.treeId, | |
props.treeLabel, | |
props.treeLabelledBy, | |
renamingItem, | |
renderers, | |
search, | |
treeInformation, | |
viewState, | |
] | |
); |
This copies the treeId
and rootItem
properties but not the treeLabel
and treeLabelledBy
properties that are expected by the TreeConfiguration
interface that TreeInformation
inherits.
react-complex-tree/packages/core/src/types.ts
Lines 352 to 357 in 90d24f6
export interface TreeConfiguration { | |
treeId: string; | |
rootItem: string; | |
treeLabel?: string; | |
treeLabelledBy?: string; | |
} |
Metadata
Metadata
Assignees
Labels
No labels