vaadin / flow-components

Java counterpart of Vaadin Web Components
100 stars 66 forks source link

Tree component needed for accessibility reasons #5671

Open AndreasSamjeske opened 1 year ago

AndreasSamjeske commented 1 year ago

Describe your motivation

Vaadin 8 had component Tree, which had pretty decent web accessibility features: aria-labelledby, aria-level and aria-expanded were automatically managed by Vaadin. Only drawback: every element was a <div>. <ul> and <li> would have been better.

Describe the solution you'd like

Vaadin needs to have a tree, that consists of <ul> and <li>. This ensures users with screen readers are able to understand the structure easily.

Describe alternatives you've considered

Since Vaadin 10+ there isn't any Tree component. In 2019 Vaadin suggested to use TreeGrid with a single column. But in regards of web accessibility this is insufficient: For screen reader users the grid structure is way too confusing and unnecessarily complex.

In Vaadin directory there is a tree, too. But in HTML this is a grid as well.

Additional context

Accordion might be an alternative, if you have only one level of depth. But it lacks attribute aria-level and aria-expanded.

web-padawan commented 1 year ago

Related issue in the web components repo: https://github.com/vaadin/web-components/issues/4414

yuriy-fix commented 1 year ago

Have renamed the issue to make it more discoverable.

enver-haase commented 5 months ago

@yuriy-fix can you maybe add something about a11y to the issue title? The current one IMHO is not nailing it.