dasDaniel / svelte-table

A svelte table implementation that allows sorting and filtering
https://dasdaniel.github.io/svelte-table/
MIT License
535 stars 40 forks source link

A11y warnings #112

Closed VirgileD closed 2 years ago

VirgileD commented 2 years ago

Hello, using the latest sveltekit and v0.5.1 svelte-table package, I've got two A11y related warnings I'd like to get rid of:

11:45:09 AM [vite-plugin-svelte] /home/XXX/project/node_modules/svelte-table/src/SvelteTable.svelte:340:12 A11y: visible, non-interactive elements with an on:click event must be accompanied by an on:keydown, on:keyup, or on:keypress event.
11:45:09 AM [vite-plugin-svelte] /home/XXX/project/node_modules/svelte-table/src/SvelteTable.svelte:365:12 A11y: visible, non-interactive elements with an on:click event must be accompanied by an on:keydown, on:keyup, or on:keypress event.

The first one is related to the handleClickCell td's event, the second one to the handleClickExpand. So either we could add a role="none" in the two td tags or try to handle the keydown maybe just use the same handlers as the on:click?

What do you think?

dasDaniel commented 2 years ago

svelte repl is showing these too now. It's a valid concern and should also include ability to tab through the filter headers which is also not possible at the moment.

dasDaniel commented 2 years ago

got a PR I'll be merging soon if you want to have a look and test https://github.com/dasDaniel/svelte-table/pull/115