inertiajs / inertia

Inertia.js lets you quickly build modern single-page React, Vue and Svelte apps using classic server-side routing and controllers.
https://inertiajs.com
MIT License
6.3k stars 423 forks source link

Fix svelte 4 warning for ARIA role #1835

Closed Isaac-alencar closed 5 months ago

Isaac-alencar commented 6 months ago

1627

If as is neither 'a' nor 'button', it spreads the { role, tabindex } object. if role is 'button', it won't be included as an attribute on the element, ensuring that the correct role is applied based on the element type specified by the as variable.

reinink commented 5 months ago

Hey! Thanks for this contribution, but I just tested this, and I'm still getting an ARIA warning:

vite v4.5.2 building SSR bundle for production...
transforming (27) ../../packages/svelte/src/index.js8:17:43 AM [vite-plugin-svelte] /Users/jonathanreinink/Sites/inertiajs-inertia/packages/svelte/src/Link.svelte:27:0 A11y: <svelte:element> with click, dblclick, mousedown, mousemove, mouseout, mouseover, mouseup handlers must have an ARIA role

What am I missing? 🤔

reinink commented 5 months ago

Think I'm going to just add a svelte-ignore for now to solve this, as I'm nervous about adding a role or tabIndex. I'm pretty sure this is a false positive, as @jessarcher suggested in #1635. Thanks either way for this contribution!! 🤙

Isaac-alencar commented 5 months ago

Think I'm going to just add a svelte-ignore for now to solve this, as I'm nervous about adding a role or tabIndex. I'm pretty sure this is a false positive, as @jessarcher suggested in #1635. Thanks either way for this contribution!! 🤙

sounds good to me! thank you for the support on this one!