lukasbach / react-complex-tree

Unopinionated Accessible Tree Component with Multi-Select and Drag-And-Drop
https://rct.lukasbach.com
MIT License
952 stars 77 forks source link

treeLabel and treeLabeledBy are not passed to treeInformation #195

Closed dlech closed 1 year ago

dlech commented 1 year ago

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:

Expected behavior The label should be assigned (via aria-label attribute).

Additional context Related code:

https://github.com/lukasbach/react-complex-tree/blob/90d24f64ee3455e019000248cd445fb84e1fb792/packages/core/src/tree/Tree.tsx#L48-L75

This copies the treeId and rootItem properties but not the treeLabel and treeLabelledBy properties that are expected by the TreeConfiguration interface that TreeInformation inherits.

https://github.com/lukasbach/react-complex-tree/blob/90d24f64ee3455e019000248cd445fb84e1fb792/packages/core/src/types.ts#L352-L357

lukasbach commented 1 year ago

Hi, thanks for noticing the issue and reporting! This is now fixed as of 2.0.1.