Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rethink Default ARIA Roles for Headless DataCollection #827

Open
Lysander opened this issue Dec 12, 2023 · 0 comments
Open

Rethink Default ARIA Roles for Headless DataCollection #827

Lysander opened this issue Dec 12, 2023 · 0 comments
Labels
discussion Extra attention is needed headless All about headless components and foundations

Comments

@Lysander
Copy link
Collaborator

Lysander commented Dec 12, 2023

Currently some default ARIA-Roles are set inside the headless datatable bricks:

  • dataCollectionItems -> list
  • dataCollectionItem -> listitem

This design has different problems:
The ARIA Role for the main collection type might be suited at the wrong DOM-level: If you want to create some Datatable alike component, dataCollectionItems is located beneath some potential table-Tag. But the latter defines implicitly the ARIA role. In order to achieve this, you are forced to write some "reset" alike statement:

// inside some render-Code:
dataCollection(
        tag = RenderContext::table // this already defines the `table` role!
    ) {
    dataCollectionItems(...) {
        attr("role", "")  // reset default headless role one level beneath and without any obvious relation to the tag above!
        items.renderEach(...) { item ->
            dataCollectionItem(item, tag = RenderContext::tr) {
                attr("role", "") // same again, besides this is the correct DOM level
            }
    }
}

This arises the fundamental questions:

  • Should we drop default ARIA-roles for this component?
  • Should we find a better way to support the two main collection types ( list and table) in a better way?
@Lysander Lysander added discussion Extra attention is needed headless All about headless components and foundations labels Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Extra attention is needed headless All about headless components and foundations
Projects
None yet
Development

No branches or pull requests

1 participant