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

fix error `A11y: Non-interactive element <td> cannot have interactive role 'button'` #132

Closed dasDaniel closed 1 year ago

dasDaniel commented 1 year ago

As of 3.57.0 (or some earlier version) the use of <td role="button> does not meet a11y guidelines and shows a warning.

This effects the expand/collapse button, since the current behaviour treats the cell as a button. This assignment of role="button" is needed for tabindex="0" the attribute which allows tabbing through the expand collapse buttons.

Instead of using the tabindex on the td, use a nested span