carbon-design-system / carbon

A design system built by IBM
https://www.carbondesignsystem.com
Apache License 2.0
7.87k stars 1.82k forks source link

Recommendations for TreeView accessibility #6792

Open carmacleod opened 4 years ago

carmacleod commented 4 years ago

Recommendations for improving accessibility for the (experimental) Carbon unstable_Treeview component.

dakahn commented 3 years ago

Regarding click targets from @carmacleod

I agree that we need to do something to increase the click target of expandable treeitems.

I understand that Carbon wants to keep the "don't expand on click" behavior, so here's a suggestion: the Windows Explorer tree expands when you double-click on an expandable treeitem (the Mac Finder kind of does something similar, although double-click "expands" by showing the contents of the folder in a reduced tree). So consider adding "double-click expands" behavior. You might want to make it a prop? i.e. doubleClickExpands or singleClickExpands - depending on which one would be a better default behavior for Carbon use cases. Note that single-click expansion is pretty common for trees, too. Check out these trees: