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

Solve the ARIA-ROLE error thrown @Part 2/Actions/The use directive #554

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Ayyanaruto
Copy link

Screenshot from 2024-01-01 12-55-02

Added a role attribute to remove the warning in both unsolved and solved one

Copy link

vercel bot commented Jan 1, 2024

@Ayyanaruto is attempting to deploy a commit to the Svelte Team on Vercel.

A member of the Team first needs to authorize it.

@Rich-Harris
Copy link
Member

Rich-Harris commented Jan 23, 2024

thank you! @geoffrich can I ask you to take a look at this — is presentation the right role, or would button (or something else) be more correct in this case?

@Rich-Harris
Copy link
Member

Oh and there's also #567 which additionally adds an aria-label — is that appropriate in this context?

@geoffrich
Copy link
Member

Hm, I think this is actually a case where it's perfectly valid to ignore the warning. Maybe we want to add the svelte-ignore comment to this example?

In general, you don't want to put click handlers on divs. However, in this case a screen reader can close the modal with the Escape key, so we aren't locking any functionality behind clicking with a mouse.

I'd have to test with a screen reader to be sure, but I don't think role="presentation" will actually do anything tangible other than silence Svelte's warning. A div is already meaningless, semantically.

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

Successfully merging this pull request may close these issues.

None yet

3 participants