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

Why does <slot> not allow role? #546

Open
keithamus opened this issue May 10, 2024 · 3 comments
Open

Why does <slot> not allow role? #546

keithamus opened this issue May 10, 2024 · 3 comments
Assignees

Comments

@keithamus
Copy link
Member

Currently <slot> has no corresponding role (that's fine) but it also doesn't map the WAI-ARIA role, meaning role= simply does nothing on a slot. Is there a good reason to do this? It's a little perculiar to me, considering the other elements that don't map are generally non structural elements, e.g. <title>, <meta>, <script> and so on.

I've run into scenarios where a shadowdom has an existing <div role=something>, and a request has come in to be able to customise the children of this element. Easy enough! Let the <div> become a <slot>, but oh, no! No more role. Instead we need to introduce additional elements to the shadowdom markup to work around this limitation, which can sometimes be a little tricky trying to balance the constraints of customisability vs creating a structure that maps nicely to the accessibility tree.

I haven't found any existing discussion, nor does anything jump out to me as to why this limitation exist. I'm wondering if it's a limitation we can lift?

@scottaohara
Copy link
Member

@keithamus this is the rational i was given when trying to determine role allowances for slot for the ARIA in HTML spec - validator/validator#1095 (comment)

jist being that slot is not an element that is meant to be exposed to users at all. so putting a role on it is completely at odds with its purpose.

@spectranaut
Copy link
Contributor

This was discussed briefly during triage in today's meeting: https://www.w3.org/2024/05/16-aria-minutes#t01

@spectranaut
Copy link
Contributor

Discussed in today's meeting: https://www.w3.org/2024/05/23-aria-minutes.html#t07

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants