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

chore(a11y): silence new a11y warnings from [email protected] #1703

Merged
merged 5 commits into from
Mar 26, 2023

Conversation

metonym
Copy link
Collaborator

@metonym metonym commented Mar 25, 2023

Closes #1683, closes #1704

There is a slew of new a11y warnings in Svelte version >=3.57. This causes warnings to be emitted in the console when consuming this library.

Let's silence these warnings as I believe most if not all are false positives. We can resolve any actual warnings in follow-ups; let's not impede the developer experience for users using the latest Svelte version.

This is best reviewed by commit:

  • upgrade svelte to 3.57
  • upgrade svelte-check (housekeeping) reverted since it was causing an unrelated CI error
  • silence new a11y warnings

To test this locally, you can run either of the following:

yarn svelte-check --workspace src

# OR

yarn build:lib

The expected result is that there should be no a11y warnings emitted to the console.

Copy link
Collaborator

@theetrain theetrain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything else looks good! I double checked wai-aria and most of these are false warnings given that descendents of these items are properly interactive with a keyboard. I suppose <slot> throws off the compiler.

Example menu: https://w3c.github.io/aria/#menu

src/ProgressIndicator/ProgressStep.svelte Outdated Show resolved Hide resolved
@theetrain theetrain merged commit c00df40 into master Mar 26, 2023
@theetrain theetrain deleted the fix-a11y branch March 26, 2023 19:28
@pwwang
Copy link

pwwang commented Apr 3, 2023

Note that this solution doesn't work for vite (@sveltejs/vite-plugin-svelte). Need a workaround to suppress them:

export default defineConfig({
  plugins: [
    svelte({
      onwarn: (warning, handler) => {
        if (warning.code === "a11y-interactive-supports-focus") return
        handler(warning)
      }
    }),
  ],
})

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