konstaui / konsta

Mobile UI components made with Tailwind CSS
https://konstaui.com
MIT License
3.55k stars 131 forks source link

A11y: visible, non-interactive elements with an on:click event must be accompanied by an on:keydown, on:keyup, or on:keypress event. #92

Open dawidmachon opened 2 years ago

dawidmachon commented 2 years ago

Check that this is really a bug

Reproduction link

.

Bug description

On compilation, your components on Svelte receiving: A11y: visible, non-interactive elements with an on:click event must be accompanied by an on:keydown, on:keyup, or on:keypress event.

It's because: Changelog from Svelte, November 2022:

New accessibility warnings, a11y-click-events-have-key-events and a11y-no-noninteractive-tabindex, will now warn when your components lack required key events or tabindex. While a11y-role-has-required-aria-props will no longer warn when elements match their semantic role (3.51.0)

Expected Behavior

No response

Actual Behavior

No response

Konsta UI version

1.02

Platform/Target and Browser Versions

windows, chrome dev 108.0.5359.10 (official) (64-bit)

Validations

Would you like to open a PR for this bug?

giviz commented 1 year ago

I had that same issue with F7 and solved it by creating a .vscode folder with a settings.json file for :

{
  "svelte.plugin.svelte.compilerWarnings": {
    "a11y-click-events-have-key-events": "ignore"
  }
}

Just in case that might help :)