rob-balfre / svelte-select

Svelte Select. A select component for Svelte
https://svelte-select-examples.vercel.app
Other
1.26k stars 175 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. #482

Closed josdejong closed 1 year ago

josdejong commented 1 year ago

When using svelte-select in a project using the latest @sveltejs/kit@1.0.0-next.516 and vite@3.1.8, Svelte now outputs the following console warnings:

13:13:24 [vite-plugin-svelte] [...]/node_modules/svelte-select/src/Select.svelte:862:0 A11y: visible, non-interactive elements with an on:click event must be accompanied by an on:keydown, on:keyup, or on:keypress event. 13:13:25 [vite-plugin-svelte] [...]/node_modules/svelte-select/src/List.svelte:293:12 A11y: visible, non-interactive elements with an on:click event must be accompanied by an on:keydown, on:keyup, or on:keypress event. 13:13:25 [vite-plugin-svelte] [...]/node_modules/svelte-select/src/List.svelte:314:16 A11y: visible, non-interactive elements with an on:click event must be accompanied by an on:keydown, on:keyup, or on:keypress event. 13:13:25 [vite-plugin-svelte] [...]/node_modules/svelte-select/src/MultiSelection.svelte:88:12 A11y: visible, non-interactive elements with an on:click event must be accompanied by an on:keydown, on:keyup, or on:keypress event. 13:13:25 [vite-plugin-svelte] [...]/node_modules/svelte-select/src/MultiSelection.svelte:78:4 A11y: visible, non-interactive elements with an on:click event must be accompanied by an on:keydown, on:keyup, or on:keypress event.

These warnings can be fixed by either adding one of the mentioned event listeners to the div, or by putting the following ignore comment above the div:

<!-- svelte-ignore a11y-click-events-have-key-events -->

Would be great if you can fix this in the library. Or if you want I can create a PR for it.

rob-balfre commented 1 year ago

@josdejong v5 beta should be ok, presume you're talking about v4? Thanks

josdejong commented 1 year ago

Ah, you're right. Yes I'm using the latest v4. Using the latest v5 beta indeed doesn't have these warnings.

Ok I'll close this issue and await the release of v5 (I prefer not to use beta versions in production).

Thanks for all your work on this library btw, it works like a charm!

josdejong commented 1 year ago

@rob-balfre any idea when v5 will be ready?

rob-balfre commented 1 year ago

Was hoping to wait until kit release candidate, otherwise it's looking pretty stable

On Tue, 1 Nov 2022, 3:47 am Jos de Jong, @.***> wrote:

@rob-balfre https://github.com/rob-balfre any idea when v5 will be ready?

— Reply to this email directly, view it on GitHub https://github.com/rob-balfre/svelte-select/issues/482#issuecomment-1297376713, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAUAM7Q6AAICQVITFZJEFDLWF7ZZ5ANCNFSM6AAAAAARH7FQTE . You are receiving this because you were mentioned.Message ID: @.***>

josdejong commented 1 year ago

Ah ok, I can understand that 👍

josdejong commented 1 year ago

Was hoping to wait until kit release candidate, otherwise it's looking pretty stable

SvelteKit 1.0 has been released now 🎉 , time to publish svelte-select@5?