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

Fix Svelte a11y warnings #215

Merged
merged 2 commits into from
Aug 21, 2024

Conversation

ilyakamens
Copy link
Contributor

This PR fixes a few Svelte a11y warnings that appear when building a Svelte project that uses Konsta:

A11y: <svg> with click handler must have an ARIA role
A11y: <div> with click handler must have an ARIA role
A11y: <span> with click handler must have an ARIA role
A11y: <svelte:element> with click handler must have an ARIA role
A11y: visible, non-interactive elements with an on:click event must be accompanied by a keyboard event handler. Consider whether an interactive element such as <button type="button"> or <a> might be more appropriate. See https://svelte.dev/docs/accessibility-warnings#a11y-click-events-have-key-events for more details.

Screenshot of some of the warnings:

image

Some of these have (had) issues opened for them:

In the case of #155, it was closed with 59216a6, but that change didn't actually fix the file that the issue referenced (DeleteIcon.svelte).

For "A11y: visible, non-interactive elements with an on:click event must be accompanied by a keyboard event handler," I added a comment to suppress the warning because I wasn't sure what the desired fix was. I'd be happy to revisit that with more guidance if desired.

Versions:

@sveltejs/vite-plugin-svelte at 3.1.1.
konsta at 3.1.3.

Thanks for your consideration.

A11y: <svg> with click handler must have an ARIA role
A11y: <div> with click handler must have an ARIA role
A11y: <span> with click handler must have an ARIA role
A11y: <svelte:element> with click handler must have an ARIA role
A11y: visible, non-interactive elements with an on:click event must be accompanied by a keyboard event handler. Consider whether an interactive element such as <button type="button"> or <a> might be more appropriate. See https://svelte.dev/docs/accessibility-warnings#a11y-click-events-have-key-events for more details.
@nolimits4web
Copy link
Member

t0ggles-create konsta

Copy link

t0ggles bot commented Aug 16, 2024

Task nolimits4web/KONSTA-90 was created

t0ggles task KONSTA-90

@t0ggles t0ggles bot added the t0ggles Linked to the t0ggles task label Aug 16, 2024
@nolimits4web nolimits4web merged commit 667c7a0 into konstaui:master Aug 21, 2024
Copy link

t0ggles bot commented Aug 21, 2024

Task nolimits4web/KONSTA-90 status changed to Done

@nolimits4web
Copy link
Member

Merged, thanks! I removed role button from irrelevant elements, as they still don't have much sense without key events handler

@ilyakamens ilyakamens deleted the ilya/fix-a11y-warnings branch September 18, 2024 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t0ggles Linked to the t0ggles task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants