The element has ARIA role="treegrid" despite it functionally being an element that should have the ARIA role="grid". Go to the Vaadin Grid component page and inspect the first table in the Accessibility tab. It has role="treegrid".
From my understanding, this is the wrong role, because the rows can not be expanded in this Component.
See treegrid role on MDN.
The correct role should be "grid", just like the name of the Component.
See MDN grid role
Am I understanding this correctly? Shouldn't the role be grid?
Note: I am an accessibility tester with no access to the source code, I found this using dev tools while inspecting my colleagues work and the Vaadin docs. This means I do not know if this is an error in the documentation and my colleagues just made the exact same error or if this is a bug in the framework.
Good catch, and yes, you are understanding this correctly.
To cite the related bug report:
What to do if you discover an error like this
1. check if the issue is known
In Open Source libraries like Vaadin, you can go to their issue tracker and search if the issue is known. Often, these are GitHub or Gitlab pages, and you usually find a link on the library’s public page in the header or the footer.
For example, this is an issue already known by their developers:
Grid uses treegrid role even when populated with only 1 level of data #4318
As you can see, these components often are able to cover much more complex scenarios, so the Grid component is capable of becoming a real tree grid, but in the configuration used in your project it’s not.
2. Create a bug report if it’s not known yet
If you cannot find anything, go ahead and file a bug report.
Usually, you’d also find some guidelines on how to do that.
3. Fix the issue in code
As I find myself repeatedly pointing out recently: There is no point in trying to fix accessibility issues from the outside of a library. It’s often a hack, therefore fragile, inefficient, and only your project profits from it.
Instead, if you have developing force, go and fix the issue at the source, if it is important to your project. This is how Open Source works in a nutshell: Somebody, for whom the issue is critical, provides a fix for everyone.
For example, the Vaadin Contribution Guide explains how to go about this.